GComm  0.2.3
evs_consensus.hpp
1 /*
2  * Copyright (C) 2009 Codership Oy <info@codership.com>
3  */
4 
5 #include "evs_seqno.hpp"
6 
7 
8 namespace gcomm
9 {
10  class UUID;
11  class View;
12  namespace evs
13  {
14  class NodeMap;
15  class InputMap;
16  class Message;
17  class Consensus;
18  }
19 }
20 
22 {
23 public:
24  Consensus(const UUID& uuid,
25  const NodeMap& known,
26  const InputMap& input_map,
27  const View& current_view) :
28  uuid_ (uuid),
29  known_ (known),
30  input_map_ (input_map),
31  current_view_(current_view)
32  { }
33 
37  bool equal(const Message&, const Message&) const;
38 
44  seqno_t highest_reachable_safe_seq() const;
45 
51 
56  bool is_consistent_input_map(const Message&) const;
57  bool is_consistent_partitioning(const Message&) const;
58  bool is_consistent_leaving(const Message&) const;
59  bool is_consistent_same_view(const Message&) const;
60  bool is_consistent(const Message&) const;
61  bool is_consensus() const;
62 private:
63 
64  const UUID& uuid() const { return uuid_; }
65 
66  const UUID& uuid_;
67  const NodeMap& known_;
68  const InputMap& input_map_;
69  const View& current_view_;
70 };
seqno_t highest_reachable_safe_seq() const
bool is_consistent_input_map(const Message &) const
bool equal(const Message &, const Message &) const
Definition: view.hpp:119
Definition: evs_node.hpp:137
bool is_consistent_highest_reachable_safe_seq(const Message &) const
Definition: evs_message2.hpp:121
Definition: evs_consensus.hpp:21
Definition: uuid.hpp:26
Definition: evs_input_map2.hpp:148