Main class of SocRob Multicast. More...
#include <manager.h>
Public Member Functions | |
Manager (ManagerOptions const &options) | |
Constructor. | |
bool | startShortRound (std::vector< uint8_t > const &question, std::set< id_type > const &required_sids, short_callback_type const &callback=empty_short_callback) |
Starts a short round for multiple agents. | |
bool | startShortRound (std::vector< uint8_t > const &question, id_type required_sid, short_callback_type const &callback=empty_short_callback) |
Starts a short round for a single agent. | |
~Manager () | |
Destructor. | |
Private Attributes | |
boost::shared_ptr< implementation > | impl_ |
Main class of SocRob Multicast.
This class is the Manager, responsible to coordinate everything.
socrob::multicast::Manager::Manager | ( | ManagerOptions const & | options | ) |
Constructor.
The Manager constructor creates the SocRob Multicast Manager and starts threads and communication. For this reason, please declare the Manager as the last variable of your class or use a shared_ptr to it, so that you initialize it only after everything is ready to start.
options | Options to be used by the Manager. |
Destructor.
The Manager destructor stops communication and threads.
bool socrob::multicast::Manager::startShortRound | ( | std::vector< uint8_t > const & | question, |
std::set< id_type > const & | required_sids, | ||
short_callback_type const & | callback = empty_short_callback |
||
) |
Starts a short round for multiple agents.
Starts a short question round that will transmit the question to all agents specified in the required_sids set. When all the answers are received or agents are considered offline, the callback will be called.
question | Question to be transmitted. |
required_sids | Set of agents that need to answer. |
callback | Callback function to be called when all answers arrive. |
bool socrob::multicast::Manager::startShortRound | ( | std::vector< uint8_t > const & | question, |
id_type | required_sid, | ||
short_callback_type const & | callback = empty_short_callback |
||
) | [inline] |
Starts a short round for a single agent.
Starts a short question round that will transmit the question to the specified agent. When the answer is received or the agent is considered offline, the callback will be called.
question | Question to be transmitted. |
required_sid | Agent that needs to answer. |
callback | Callback function to be called when all answers arrive. |
boost::shared_ptr<implementation> socrob::multicast::Manager::impl_ [private] |