#pragma once #include "config/config.hh" #include "ledger.hh" #include namespace paxos { class Legislator { public: Legislator(const LegislatorConfig& config); LegislatorConfig config_; void initiate_ballot(); void send_next_ballot(int ballot); void receive_next_ballot(int ballot, std::string sender); void receive_enough_last_vote (std::unordered_map quorum_last_votes); void receive_begin_ballot(int ballot, int decree); Ledger ledger; }; using shared_legislator = std::shared_ptr; extern shared_legislator self; extern std::unordered_map legislators; }