Hazelcast C++ Client
Cluster.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/31/13.
18 
19 #ifndef HAZElCAST_CLUSTER
20 #define HAZElCAST_CLUSTER
21 
22 #include <vector>
23 #include <boost/shared_ptr.hpp>
24 
25 #include "hazelcast/client/Member.h"
26 
27 namespace hazelcast {
28  namespace client {
29  namespace spi {
30  class ClientClusterService;
31  }
32 
33  class MembershipListener;
34 
35  class InitialMembershipListener;
36 
40  class HAZELCAST_API Cluster {
41  public:
45  Cluster(spi::ClientClusterService &clusterService);
46 
60  void addMembershipListener(MembershipListener *listener);
61 
78  std::string addMembershipListener(const boost::shared_ptr<MembershipListener> &listener);
79 
94  std::string addMembershipListener(InitialMembershipListener *listener);
95 
112  std::string addMembershipListener(const boost::shared_ptr<InitialMembershipListener> &listener);
113 
123  bool removeMembershipListener(MembershipListener *listener);
124 
136  bool removeMembershipListener(const std::string &registrationId);
137 
146  std::vector<Member> getMembers();
147 
148  private:
149  spi::ClientClusterService &clusterService;
150  };
151  }
152 }
153 
154 #endif //HAZElCAST_CLUSTER
155 
Cluster membership listener.
Definition: MembershipListener.h:64
Hazelcast cluster interface.
Definition: Cluster.h:40
The InitializingMembershipListener is a MembershipListener that will first receives a InitialMembersh...
Definition: InitialMembershipListener.h:57
PN (Positive-Negative) CRDT counter.
Definition: MapEntryView.h:32