Hazelcast C++ Client
 All Classes Functions Variables Enumerations Pages
MembershipEvent.h
1 /*
2  * Copyright (c) 2008-2015, 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  };
54 
59  MembershipEvent(Cluster &cluster, const Member &member, MembershipEventType eventType, const std::vector<Member> &membersList);
60 
64  virtual ~MembershipEvent();
65 
79  virtual const std::vector<Member> getMembers() const;
80 
86  virtual const Cluster &getCluster() const;
87 
94  virtual MembershipEventType getEventType() const;
95 
101  virtual const Member &getMember() const;
102 
103  private:
104  Cluster *cluster;
105  Member member;
106  MembershipEventType eventType;
107  std::vector<Member> members;
108  };
109  }
110 }
111 
112 #if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
113 #pragma warning(pop)
114 #endif
115 
116 #endif //HAZELCAST_MembershipEvent
117 
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:44