gramods
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
gramods::gmNetwork::SyncNode::Impl Struct Reference
Inheritance diagram for gramods::gmNetwork::SyncNode::Impl:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmNetwork::SyncNode::Impl:
Collaboration graph
[legend]

Classes

struct  Peer
 A connection and communication handler for one single peer. More...
 

Public Member Functions

bool initialize ()
 
void addPeer (std::string address)
 
void setLocalPeerIdx (size_t idx)
 
size_t getLocalPeerIdx ()
 
std::size_t getPeersCount ()
 
std::set< std::size_t > getConnectedPeers ()
 
float getTimeoutDelay ()
 
void waitForConnection ()
 
bool isConnected ()
 
void sendMessage (Protocol::Message mess)
 
void addProtocol (std::string name, std::shared_ptr< Protocol > prot)
 
void runContext ()
 
void accept ()
 
void on_accept (std::error_code ec, asio::ip::tcp::socket socket)
 
void lost_connection (Peer *peer)
 
void routeMessage (Protocol::Message mess)
 

Static Public Member Functions

static void split_address_service (std::string comb, std::string &host, std::string &port)
 

Public Attributes

asio::io_context io_context
 
std::thread io_thread
 
std::mutex impl_lock
 
std::vector< std::shared_ptr< Peer > > alpha_peers
 
std::vector< std::shared_ptr< Peer > > beta_peers
 
std::vector< std::string > peer_addresses
 
std::size_t local_peer_idx = std::numeric_limits<size_t>::max()
 
bool exit_when_a_peer_is_disconnected = false
 
float timeout_delay = 5.f
 
std::set< std::size_t > connected_peers
 
std::unique_ptr< asio::ip::tcp::acceptor > server_acceptor
 
std::vector< Protocol::Messageunprocessed_messages
 
std::unordered_map< char, std::shared_ptr< Protocol > > protocols
 
std::unordered_map< std::string, char > protocol_id_by_name
 
std::condition_variable waiting_condition
 

The documentation for this struct was generated from the following file: