Hazelcast C++ Client
Member.h
1 /*
2  * Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 //
17 // Created by sancar koyunlu on 5/29/13.
18 
19 
20 
21 #ifndef HAZELCAST_MEMBER
22 #define HAZELCAST_MEMBER
23 
24 #include <map>
25 #include <memory>
26 
27 #include "hazelcast/client/Address.h"
28 
29 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
30 #pragma warning(push)
31 #pragma warning(disable: 4251) //for dll export
32 #endif
33 
34 namespace hazelcast {
35  namespace client {
36 
43  class HAZELCAST_API Member {
44  public:
50  PUT = 1,
51  REMOVE = 2
52  };
53 
54  Member();
55 
56  Member(const Address &address, const std::string &uuid, bool lite,
57  const std::map<std::string, std::string> &attr);
58 
59  Member(const Address &memberAddress);
60 
61  Member(const std::string &uuid);
62 
66  bool operator==(const Member &) const;
67 
73  bool isLiteMember() const;
74 
80  const Address &getAddress() const;
81 
87  const std::string &getUuid() const;
88 
89  const std::map<std::string, std::string> &getAttributes() const;
90 
99  const std::string *getAttribute(const std::string &key) const;
100 
107  bool lookupAttribute(const std::string &key) const;
108 
109  bool operator<(const Member &rhs) const;
110 
111  void updateAttribute(MemberAttributeOperationType operationType, const std::string &key,
112  std::auto_ptr<std::string> &value);
113 
114  private:
115  Address address;
116  std::string uuid;
117  bool liteMember;
118  std::map<std::string, std::string> attributes;
119  };
120 
121  std::ostream HAZELCAST_API &operator<<(std::ostream &out, const Member &member);
122  }
123 }
124 
125 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
126 #pragma warning(pop)
127 #endif
128 
129 
130 #endif //HAZELCAST_MEMBER
131 
IP Address.
Definition: Address.h:41
Cluster member class.
Definition: Member.h:43
MemberAttributeOperationType
PUT even type representing an addition of an attribute REMOVE event type representing a deletion of a...
Definition: Member.h:49
Definition: MapEntryView.h:32