Zero Module Framework
1.0
A framework for running distributed modules using a ZMQ message bus
|
#include <PeerRegistryInternal.hpp>
Public Member Functions | |
PeerRegistryInternal () | |
virtual | ~PeerRegistryInternal () |
void | addModule (std::shared_ptr< zmf::data::ModuleHandle > toAdd, zmf::data::ModuleState state, std::vector< uint8_t > additionalState) |
void | removeModule (zmf::data::ModuleUniqueId toRemoveId) |
void | clearRegistry () |
std::map < zmf::data::ModuleUniqueId, std::shared_ptr < zmf::data::ModuleHandle > > & | INTERNAL_getAllPeers (bool onlyActivePeers=true) |
std::map< uint16_t, std::list < std::shared_ptr < zmf::data::ModuleHandle > > > & | INTERNAL_getAllPeersByType (bool onlyActivePeers=true) |
void | INTERNAL_updatePeerState (zmf::data::ModuleUniqueId module, zmf::data::ModuleState newState) |
void | INTERNAL_updatePeerAdditionalState (zmf::data::ModuleUniqueId module, std::vector< uint8_t > newAdditionalState) |
std::mutex & | getPeerRegistryLock () |
virtual void | printPeerRegistry () override |
The PeerRegistry keeps track of every module in the network. It tracks their state and is able to provide information about all those modules. Derived class from PeerRegistry which implements the internal functions such as add, remove, clear and update.
|
inline |
|
virtual |
void zmf::discovery::PeerRegistryInternal::addModule | ( | std::shared_ptr< zmf::data::ModuleHandle > | toAdd, |
zmf::data::ModuleState | state, | ||
std::vector< uint8_t > | additionalState | ||
) |
Adds the given module to the registry
void zmf::discovery::PeerRegistryInternal::clearRegistry | ( | ) |
Clears the registry
|
inline |
|
inline |
Warning: Returns reference unsynchronized, internal datastructures Returns the internal data structure with all peers, sorted by ID Contract: No guarantee that data structure not changed concurrently. Copy recommended. Performance: Direct return of map, very fast
onlyActivePeers | Returns only all active peers |
|
inline |
Warning: Returns reference unsynchronized, internal datastructures Returns the internal data structure with all peers, sorted by Type Contract: No guarantee that data structure not changed concurrently. Copy recommended. Performance: Direct return of map, very fast
onlyActivePeers | Returns only all active peers |
void zmf::discovery::PeerRegistryInternal::INTERNAL_updatePeerAdditionalState | ( | zmf::data::ModuleUniqueId | module, |
std::vector< uint8_t > | newAdditionalState | ||
) |
Updates the additional state of the given module from the registry
void zmf::discovery::PeerRegistryInternal::INTERNAL_updatePeerState | ( | zmf::data::ModuleUniqueId | module, |
zmf::data::ModuleState | newState | ||
) |
Updates the state of the given module from the registry
|
overridevirtual |
void zmf::discovery::PeerRegistryInternal::removeModule | ( | zmf::data::ModuleUniqueId | toRemoveId | ) |
Removes the given module from the registry