#include <ZmqZmfMessagingServiceImplementation.hpp>
"real" implementation of the IZmfMessagingService. Public interface matches IZmfMessagingService
- Author
- Jan Strauß
- Date
- created on 7/7/15.
zmf::messaging::ZmqZmfMessagingServiceImplementation::ZmqZmfMessagingServiceImplementation |
( |
zmf::data::ModuleUniqueId |
moduleId | ) |
|
zmf::messaging::ZmqZmfMessagingServiceImplementation::~ZmqZmfMessagingServiceImplementation |
( |
| ) |
|
|
virtual |
void zmf::messaging::ZmqZmfMessagingServiceImplementation::cancelRequest |
( |
uint64_t |
requestID, |
|
|
bool |
manual |
|
) |
| |
|
virtual |
Removes the internal resources mapped to the given requestID. To be called internally from a ZmfInReply if it is cancelled.
- Parameters
-
requestID | the id of the request to cancel |
Implements zmf::messaging::IZmfMessagingService.
void zmf::messaging::ZmqZmfMessagingServiceImplementation::onDisable |
( |
| ) |
|
|
virtual |
void zmf::messaging::ZmqZmfMessagingServiceImplementation::peerJoin |
( |
std::shared_ptr< zmf::data::ModuleHandle > |
module | ) |
|
|
virtual |
void zmf::messaging::ZmqZmfMessagingServiceImplementation::peerLeave |
( |
std::shared_ptr< zmf::data::ModuleHandle > |
module | ) |
|
|
virtual |
void zmf::messaging::ZmqZmfMessagingServiceImplementation::publish |
( |
const zmf::data::ZmfMessage & |
msg | ) |
|
|
virtual |
void zmf::messaging::ZmqZmfMessagingServiceImplementation::sendReply |
( |
ExternalRequestIdentity |
requestID, |
|
|
const zmf::data::ZmfMessage & |
reply |
|
) |
| |
|
virtual |
Sends the given reply to the sender of the request with the given id. Should be wrapped from the module.
- Parameters
-
requestID | the id of the request to reply to |
response | the response to send |
Implements zmf::messaging::IZmfMessagingService.
zmf::data::ZmfInReply zmf::messaging::ZmqZmfMessagingServiceImplementation::sendRequest |
( |
const zmf::data::ModuleUniqueId & |
target, |
|
|
const zmf::data::ZmfMessage & |
msg |
|
) |
| |
|
virtual |
Sends the given message to the given peer. A ZmfInReply is returned providing a handle for the outstanding response.
- Parameters
-
target | the identity of the receiver |
msg | the Message to send |
- Returns
- ZmfInReply a handle for the outstanding response. May be passed to the module.
Implements zmf::messaging::IZmfMessagingService.
bool zmf::messaging::ZmqZmfMessagingServiceImplementation::start |
( |
IZmfMessagingCoreInterface *const |
corePtr, |
|
|
std::shared_ptr< zmf::data::ModuleHandle > |
selfHandle, |
|
|
std::shared_ptr< zmf::config::IConfigurationProvider > |
config |
|
) |
| |
|
virtual |
Starts the ZMQ Service. After the service successfully started, the other methods may be called and the implementation will start to deliver incoming events to the provided IZmfMessagingCoreInterface.
- Parameters
-
core | pointer to the IZmfMessagingCoreInterface implementation that provides methods implementations of this class will interact with. |
selfHandle | shared_ptr to the ModuleHandle describing the module instance running on top of this ZMF instance |
- Returns
- Returns true if started successfully, false otherwise
Implements zmf::messaging::IZmfMessagingService.
void zmf::messaging::ZmqZmfMessagingServiceImplementation::stop |
( |
| ) |
|
|
virtual |
Stops the ZMQ Service. After the service is stopped, calling any method except the start method will not have any effect. Also the implementation will remove any state (peer information, outstanding messages) currently stored.
Implements zmf::messaging::IZmfMessagingService.
void zmf::messaging::ZmqZmfMessagingServiceImplementation::subscribe |
( |
const zmf::data::MessageType & |
topic | ) |
|
|
virtual |
Adds a subscription for the given topic. Semantics are equivalent to the ZMQ subscription ones.
- Parameters
-
topic | the MessageType to subscribe on |
Implements zmf::messaging::IZmfMessagingService.
void zmf::messaging::ZmqZmfMessagingServiceImplementation::unsubscribe |
( |
const zmf::data::MessageType & |
topic | ) |
|
|
virtual |
Removes a subscription for the given topic. Semantics are equivalent to the ZMQ subscription ones.
- Parameters
-
topic | the MessageType to unsubscribe from |
Implements zmf::messaging::IZmfMessagingService.
The documentation for this class was generated from the following files: