Go to the documentation of this file.
32 #ifndef MESSAGE_MANAGER_H
33 #define MESSAGE_MANAGER_H
52 namespace message_manager
264 this->connection_ = connection;
286 this->num_handlers_ = num_handlers;
295 #endif //MESSAGE_MANAGER
industrial::ping_handler::PingHandler & getPingHandler()
Gets ping handler.
industrial::smpl_msg_connection::SmplMsgConnection * connection_
Reference to reply connection (called if incoming message requires a reply)
MessageManager()
Constructor.
bool add(industrial::message_handler::MessageHandler *handler, bool allow_replace=false)
Adds a message handler to the manager.
industrial::comms_fault_handler::CommsFaultHandler * getCommsFaultHandler()
Gets communications fault handler.
Interface definition for message handlers. The interface defines the callback function that should ex...
unsigned int num_handlers_
Number of handlers.
~MessageManager()
Destructor.
static const unsigned int MAX_NUM_HANDLERS
Maximum number of handlers.
industrial::ping_handler::PingHandler ping_hndlr_
Internal ping handle (by default every message manager can handle pings)
industrial::message_handler::MessageHandler * getHandler(int msg_type)
Gets message handler for specific message type.
void setConnection(industrial::smpl_msg_connection::SmplMsgConnection *connection)
Sets connection manager.
industrial::simple_comms_fault_handler::SimpleCommsFaultHandler def_comms_hndlr_
Internal default comms handler (this is used if a communications fault handler is not specified as pa...
industrial::simple_comms_fault_handler::SimpleCommsFaultHandler & getDefaultCommsFaultHandler()
Gets default communications fault handler.
industrial::comms_fault_handler::CommsFaultHandler * comms_hndlr_
Reference to comms handler.
Default implementation of comms fault handler. This class attempts to reconnect if the connection is ...
void spin()
Perform a indefinite execution of the message manager.
industrial::smpl_msg_connection::SmplMsgConnection * getConnection()
Gets connection for manager.
void setNumHandlers(unsigned int num_handlers)
Sets message type that callback expects.
Defines an interface and common methods for sending simple messages (see simple_message)....
The message manager handles communications for a simple server.
bool init(industrial::smpl_msg_connection::SmplMsgConnection *connection)
Class initializer.
int getHandlerIdx(int msg_type)
Gets index of message handler for specific message type.
unsigned int getMaxNumHandlers()
Gets maximumn number of handlers.
void setCommsFaultHandler(industrial::comms_fault_handler::CommsFaultHandler *handler)
Gets communications fault handler.
void spinOnce()
Perform an single execution of the message manager (a single receive and send (if required)
Interface definition for communications fault handler. Defines the type of communcations faults that ...
industrial::message_handler::MessageHandler * handlers_[MAX_NUM_HANDLERS]
buffer of handlers
unsigned int getNumHandlers()
Gets number of handlers.
Message handler that handles ping messages.
simple_message
Author(s): Shaun Edwards
autogenerated on Wed Mar 2 2022 00:24:53