Hazelcast C++ Client
MembershipEvent.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 23/01/14.
18 //
19 
20 #ifndef HAZELCAST_MembershipEvent
21 #define HAZELCAST_MembershipEvent
22 
23 #include <vector>
24 #include "hazelcast/client/Member.h"
25 
26 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
27 #pragma warning(push)
28 #pragma warning(disable: 4251) //for dll export
29 #endif
30 
31 namespace hazelcast {
32  namespace client {
33 
34  class Cluster;
35 
42  class HAZELCAST_API MembershipEvent {
43  public:
51  MEMBER_ADDED = 1,
52  MEMBER_REMOVED = 2,
53  MEMBER_ATTRIBUTE_CHANGED = 5
54  };
55 
60  MembershipEvent(Cluster &cluster, const Member &member, MembershipEventType eventType,
61  const std::vector<Member> &membersList);
62 
66  virtual ~MembershipEvent();
67 
81  virtual const std::vector<Member> getMembers() const;
82 
88  virtual const Cluster &getCluster() const;
89 
96  virtual MembershipEventType getEventType() const;
97 
103  virtual const Member &getMember() const;
104 
105  private:
106  Cluster *cluster;
107  Member member;
108  MembershipEventType eventType;
109  std::vector<Member> members;
110  };
111  }
112 }
113 
114 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
115 #pragma warning(pop)
116 #endif
117 
118 #endif //HAZELCAST_MembershipEvent
119 
Membership event fired when a new member is added to the cluster and/or when a member leaves the clus...
Definition: MembershipEvent.h:42
MembershipEventType
MembershipEventType.
Definition: MembershipEvent.h:50
Hazelcast cluster interface.
Definition: Cluster.h:40
Cluster member class.
Definition: Member.h:43
Definition: MapEntryView.h:32