4S Device Communication Module Collection  Version 0.6-SNAPSHOT
Full documentation of the modules in the 4SDC collection (aimed at 4SDC module developers)
FSYS::MsgSenderBase Class Reference

Type neutral message sender class. More...

#include <msgsenderbase.h>

+ Inheritance diagram for FSYS::MsgSenderBase:
+ Collaboration diagram for FSYS::MsgSenderBase:

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...
 
- Private Member Functions inherited from FSYS::Handle
 Handle (void)
 Default constructor. More...
 
 Handle (Handle &ref)
 Copy constructor for handle object. More...
 
 Handle (const Handle &ref)
 Copy constructor for handle object. More...
 
Handleoperator= (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 Private Member Functions inherited from FSYS::Handle
static HandlebroadCastHandle (void)
 Generic broadcast handle. More...
 
static Handlenull (void)
 The null handle. More...
 

Detailed Description

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.

Member Function Documentation

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.

Parameters
msgThe message that should be sent.
typeOfMsgThe type (like the typeinfo() type.
senderAddress of the sender of the message

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::shared_ptr< FSYS::BaseMsg > & FSYS::MsgSenderBase::fillOutSenderInfo ( std::shared_ptr< BaseMsg > &  msg,
MsgAddr  sender 
)
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.

Parameters
msgThe message that should have the sender info filled out
senderThe address that should be set as the sender of the message
Returns
A shared pointer to the the message given as parameter

+ Here is the caller graph for this function:

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.

Parameters
msgThe message that should be sent.
typeOfMsgType of the message that is being sent
senderAddress of the sender of the message
destinationThe destination of the message

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


The documentation for this class was generated from the following files: