Replica.h
Go to the documentation of this file.
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2017 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
9 
10 #ifndef REPLICA_H
11 #define REPLICA_H
12 
13 #include <Ice/Ice.h>
14 #include <IceStorm/Election.h>
15 #include <set>
16 
17 namespace IceStormElection
18 {
19 
21  {
22  GroupNodeInfo(int i);
23  GroupNodeInfo(int i, LogUpdate l, const Ice::ObjectPrx& o = Ice::ObjectPrx());
24  bool operator<(const GroupNodeInfo& rhs) const;
25  bool operator==(const GroupNodeInfo& rhs) const;
26  //
27  // COMPILER FIX: Clang using libc++ requires to define operator=
28  //
29 #if defined(__clang__) && defined(_LIBCPP_VERSION)
30  GroupNodeInfo& operator=(const GroupNodeInfo&);
31 #endif
32  const int id;
33  const LogUpdate llu;
34  const Ice::ObjectPrx observer;
35  };
36 
37  class Replica : public virtual IceUtil::Shared
38  {
39  public:
40 
41  virtual LogUpdate getLastLogUpdate() const = 0;
42  virtual void sync(const Ice::ObjectPrx&) = 0;
43  virtual void initMaster(const std::set<IceStormElection::GroupNodeInfo>&, const LogUpdate&) = 0;
44  virtual Ice::ObjectPrx getObserver() const = 0;
45  virtual Ice::ObjectPrx getSync() const = 0;
46  };
48 
49 }
50 
51 #endif // RELICA_H
IceStormElection::Replica
Definition: Replica.h:37
IceStormElection::GroupNodeInfo
Definition: Replica.h:20
IceStormElection::Replica::getSync
virtual Ice::ObjectPrx getSync() const =0
IceStormElection::GroupNodeInfo::operator<
bool operator<(const GroupNodeInfo &rhs) const
Definition: NodeI.cpp:95
IceStormElection::LogUpdate
A struct used for marking the last log update.
Definition: LLURecord.h:100
IceStormElection::GroupNodeInfo::operator==
bool operator==(const GroupNodeInfo &rhs) const
Definition: NodeI.cpp:101
IceStormElection::Replica::getObserver
virtual Ice::ObjectPrx getObserver() const =0
IceStormElection
Definition: DBTypes.ice:17
IceStormElection::GroupNodeInfo::id
const int id
Definition: Replica.h:32
IceStormElection::Replica::sync
virtual void sync(const Ice::ObjectPrx &)=0
IceStormElection::Replica::initMaster
virtual void initMaster(const std::set< IceStormElection::GroupNodeInfo > &, const LogUpdate &)=0
IceStormElection::GroupNodeInfo::observer
const Ice::ObjectPrx observer
Definition: Replica.h:34
IceStormElection::Replica::getLastLogUpdate
virtual LogUpdate getLastLogUpdate() const =0
IceStormElection::GroupNodeInfo::llu
const LogUpdate llu
Definition: Replica.h:33
Election.h
IceUtil::Handle
Definition: forward_declarations.h:29
IceStormElection::GroupNodeInfo::GroupNodeInfo
GroupNodeInfo(int i)
Definition: NodeI.cpp:84
IceStormElection::ReplicaPtr
IceUtil::Handle< Replica > ReplicaPtr
Definition: Replica.h:47