identt
RemoteKeeper.hpp
Go to the documentation of this file.
1 
33 #ifndef _IDENTT_HRPC_REMOTE_KEEPER_HPP_
34 #define _IDENTT_HRPC_REMOTE_KEEPER_HPP_
35 
36 #include <hrpc/HrpcClient.hpp>
37 
38 namespace identt {
39 namespace hrpc {
40 
41 class RemoteKeeper {
42 public:
43 
44  using pointer=std::shared_ptr<RemoteKeeper>;
45 
50  RemoteKeeper(identt::utils::SharedTable::pointer s);
51 
55  RemoteKeeper() = delete;
56  RemoteKeeper(const RemoteKeeper&) = delete;
57  RemoteKeeper& operator=(const RemoteKeeper&) = delete;
58 
62  virtual ~RemoteKeeper ();
63 
73  void SetHosts(identt::hrpc::StateT* state);
74 
84  void AddHost(identt::hrpc::RemoteT* rms);
85 
101  void AddHost(std::string name, uint64_t logcounter, uint64_t updated_at);
102 
112  void GetHosts(identt::hrpc::StateT* state);
113 
120  void HostUpdate();
121 
131  void MasterUpdate(uint64_t cutoff);
132 
133 private:
134  identt::utils::SharedTable::pointer stptr;
135 
136 };
137 
138 } // namespace hrpc
139 } // namespace identt
140 #endif /* _IDENTT_HRPC_REMOTE_KEEPER_HPP_ */
void SetHosts(identt::hrpc::StateT *state)
SetHosts : get list of hosts.
Definition: RemoteKeeper.cc:52
void GetHosts(identt::hrpc::StateT *state)
GetHosts : get params and list of hosts.
Definition: RemoteKeeper.cc:89
RemoteKeeper()=delete
make noncopyable
void HostUpdate()
HostUpdate: update all hosts.
Definition: RemoteKeeper.cc:112
void AddHost(identt::hrpc::RemoteT *rms)
AddHost : add a single host.
Definition: RemoteKeeper.cc:71
Definition: CryptoBase.hpp:49
virtual ~RemoteKeeper()
destructor
Definition: RemoteKeeper.cc:46
Definition: RemoteKeeper.hpp:41
void MasterUpdate(uint64_t cutoff)
MasterUpdate: elect the master based on info received after cutoff.
Definition: RemoteKeeper.cc:128