Handles applying read handlers to incoming messages.
#include <CDispatcher.hpp>
|
void | HandleRequest (boost::shared_ptr< const ModuleMessage > msg, std::string uuid) |
| Schedules a message delivery to the receiving modules. More...
|
|
void | RegisterReadHandler (boost::shared_ptr< IDGIModule > p_handler, std::string id) |
| Registers a module's identifier with the dispatcher. More...
|
|
freedm::broker::CDispatcher::CDispatcher |
( |
| ) |
|
|
inlineprivate |
void freedm::broker::CDispatcher::HandleRequest |
( |
boost::shared_ptr< const ModuleMessage > |
msg, |
|
|
std::string |
uuid |
|
) |
| |
CDispatcher::HandleRequest
- Description:
- Given an input property tree determine which handlers should be given the message out of a pool of modules and schedule the delievery of the message to those modules.
- Precondition:
- Modules have registered their read handlers.
- Postcondition:
- Message is scheduled to be delivered to the module.
- Parameters
-
msg | The message to distribute to modules. |
uuid | The UUID of the DGI that sent the message. |
CDispatcher & freedm::broker::CDispatcher::Instance |
( |
| ) |
|
|
static |
CDispatcher::Instance
- Description:
- Access the singleton instance of the Dispatcher
- Precondition:
- None
- Postcondition:
- None
- Returns
- A reference to the dispatcher.
void freedm::broker::CDispatcher::ReadHandlerCallback |
( |
boost::shared_ptr< IDGIModule > |
h, |
|
|
boost::shared_ptr< const ModuleMessage > |
msg, |
|
|
std::string |
uuid |
|
) |
| |
|
private |
CDispatcher::ReadHandlerCallback
- Description:
- Calls the receiving module's message handler for the received message.
- Parameters
-
h | The module that will receive the message. |
msg | The message to deliver to that module. |
uuid | the UUID of the peer that sent the message. |
void freedm::broker::CDispatcher::RegisterReadHandler |
( |
boost::shared_ptr< IDGIModule > |
handler, |
|
|
std::string |
id |
|
) |
| |
CDispatcher::RegisterReadHandler
- Description:
- Registers a module to receive messages addressed to a uuid. Every registeredmodule will additionally receive messages addressed to "all". Modules can register as "all" to recieve all messages from all modules.
- Parameters
-
handler | the module that will receive the message |
id | this module will receive messages addressed to id. If id is "all" the module will receiver every message from every other module. |
std::multimap<boost::shared_ptr<IDGIModule>, const std::string> freedm::broker::CDispatcher::m_registrations |
|
private |
The documentation for this class was generated from the following files:
- /home/docs/checkouts/readthedocs.org/user_builds/freedm/checkouts/latest/Broker/src/CDispatcher.hpp
- /home/docs/checkouts/readthedocs.org/user_builds/freedm/checkouts/latest/Broker/src/CDispatcher.cpp