1 #ifndef paxos_protocol_h
2 #define paxos_protocol_h
12 class paxos_protocol {
14 enum status : status_t { OK, ERR };
15 enum rpc_numbers : proc_t {
30 inline unmarshall & operator>>(unmarshall &u, prop_t &a) { return u >> a.n >> a.m; }
31 inline marshall & operator<<(marshall &m, prop_t a) { return m << a.n << a.m; }
32 inline bool operator>(const prop_t &a, const prop_t &b) { return tie(a.n, a.m) > tie(b.n, b.m); }
33 inline bool operator>=(const prop_t &a, const prop_t &b) { return tie(a.n, a.m) >= tie(b.n, b.m); }
35 inline unmarshall & operator>>(unmarshall &u, paxos_protocol::prepareres &r) {
36 return u >> r.oldinstance >> r.accept >> r.n_a >> r.v_a;
39 inline marshall & operator<<(marshall &m, paxos_protocol::prepareres r) {
40 return m << r.oldinstance << r.accept << r.n_a << r.v_a;