1 #ifndef paxos_protocol_h
2 #define paxos_protocol_h
11 class paxos_protocol {
13 enum status : status_t { OK, ERR };
14 enum rpc_numbers : proc_t {
45 inline unmarshall & operator>>(unmarshall &u, prop_t &a) {
46 return u >> a.n >> a.m;
49 inline marshall & operator<<(marshall &m, prop_t a) {
50 return m << a.n << a.m;
53 inline unmarshall & operator>>(unmarshall &u, paxos_protocol::preparearg &a) {
54 return u >> a.instance >> a.n;
57 inline marshall & operator<<(marshall &m, paxos_protocol::preparearg a) {
58 return m << a.instance << a.n;
61 inline unmarshall & operator>>(unmarshall &u, paxos_protocol::prepareres &r) {
62 return u >> r.oldinstance >> r.accept >> r.n_a >> r.v_a;
65 inline marshall & operator<<(marshall &m, paxos_protocol::prepareres r) {
66 return m << r.oldinstance << r.accept << r.n_a << r.v_a;
69 inline unmarshall & operator>>(unmarshall &u, paxos_protocol::acceptarg &a) {
70 return u >> a.instance >> a.n >> a.v;
73 inline marshall & operator<<(marshall &m, paxos_protocol::acceptarg a) {
74 return m << a.instance << a.n << a.v;
77 inline unmarshall & operator>>(unmarshall &u, paxos_protocol::decidearg &a) {
78 return u >> a.instance >> a.v;
81 inline marshall & operator<<(marshall &m, paxos_protocol::decidearg a) {
82 return m << a.instance << a.v;