![]() |
4S Device Communication Module Collection
Version 0.6-SNAPSHOT
Full documentation of the modules in the 4SDC collection (aimed at 4SDC module developers)
|
|
Type neutral message sender class. More...
#include <msgsenderbase.h>
Public Member Functions | |
void | broadcast (std::shared_ptr< BaseMsg > &msg, const std::type_info &typeOfMsg, const MsgAddr &sender) |
Broadcast function, to broadcast messages. More... | |
void | send (std::shared_ptr< BaseMsg > &msg, const std::type_info &typeOfMsg, const FSYS::MsgAddr &sender, const MsgAddr &destination) |
Type independent respond function. More... | |
Private Member Functions | |
std::shared_ptr< BaseMsg > & | fillOutSenderInfo (std::shared_ptr< BaseMsg > &msg, MsgAddr sender) |
Function that fills out info about the sender of the message. More... | |
![]() | |
Handle (void) | |
Default constructor. More... | |
Handle (Handle &ref) | |
Copy constructor for handle object. More... | |
Handle (const Handle &ref) | |
Copy constructor for handle object. More... | |
Handle & | operator= (Handle const &theOtherOne) |
bool | operator== (Handle const &compareTo) const |
Equality comparator. More... | |
bool | operator!= (Handle const &compareTo) const |
Not equalify operator. More... | |
bool | operator> (Handle const &compareTo) const |
Greater than operator ('>') More... | |
bool | operator< (Handle const &compareTo) const |
Less than operator ('<') More... | |
Additional Inherited Members | |
![]() | |
static Handle & | broadCastHandle (void) |
Generic broadcast handle. More... | |
static Handle & | null (void) |
The null handle. More... | |
This is the sender base class, the sender class uses the thin template priciple, where the type specific code is concentrated in one class and the type generic code is in a different base class, this is that base class.
void FSYS::MsgSenderBase::broadcast | ( | std::shared_ptr< BaseMsg > & | msg, |
const std::type_info & | typeOfMsg, | ||
const MsgAddr & | sender | ||
) |
This is a type neutral function that broadcasts a message. It takes the type info of the message as parameter as well as the message it self.
msg | The message that should be sent. |
typeOfMsg | The type (like the typeinfo() type. |
sender | Address of the sender of the message |
|
private |
This function fills out the sender information, like queue handle, instance handle og magic key of the sender, so a response function later can determine where the result should be sent to.
msg | The message that should have the sender info filled out |
sender | The address that should be set as the sender of the message |
void FSYS::MsgSenderBase::send | ( | std::shared_ptr< BaseMsg > & | msg, |
const std::type_info & | typeOfMsg, | ||
const FSYS::MsgAddr & | sender, | ||
const MsgAddr & | destination | ||
) |
This function is used for sending a message back to an instance of a class that previously had sent the "received" message.
msg | The message that should be sent. |
typeOfMsg | Type of the message that is being sent |
sender | Address of the sender of the message |
destination | The destination of the message |