Class which manages the logic relative to send/receive messages. This class implements all the logic necessary to queue messages, to retry sends or to discard messages.

#include <messageManager.h>

Inheritance diagram for MessageManager:

Public Member Functions

boost::system::error_code subscribe (MessageManagerObserver *observer)
 
boost::system::error_code unsubscribe (MessageManagerObserver *observer)
 
boost::system::error_code sendAsync (const Transaction &transaction)
 
virtual bool rebootCommunications ()=0
 Method to be called when maximum consecutive errors have been reached. More...
 
boost::system::error_code sendSync (Transaction &transaction)
 

Static Public Member Functions

static std::string stringToHex (const std::string &input, bool printAsciiChar)
 

Protected Member Functions

virtual boost::system::error_code send (std::string message)=0
 Method to send the messages. More...
 
void receivedMessage (const char *data, size_t size)
 Method for notify received messages. More...
 
virtual boost::system::error_code receiveUntil (int timeout, std::string &receivedResponse)
 

Protected Attributes

boost::asio::io_service mIo
 Boost asio input output service.
 

Member Function Documentation

virtual bool rebootCommunications ( )
pure virtual
Returns
true if comunications are rebooted, false otherwise

Implemented in SerialMsgManager.

void receivedMessage ( const char *  data,
size_t  size 
)
protected
Parameters
databuffer for received data
sizesize for received message
virtual boost::system::error_code send ( std::string  message)
protectedpure virtual
Parameters
messageMessage to be sent
Returns