Message interface for typed messages built from SimpleMessage. More...
#include <typed_message.h>
Public Member Functions | |
int | getMessageType () const |
gets message type (enumeration) | |
virtual bool | init (industrial::simple_message::SimpleMessage &msg)=0 |
Initializes message from a simple message. | |
virtual void | init ()=0 |
Initializes a new empty message. | |
virtual bool | toReply (industrial::simple_message::SimpleMessage &msg, industrial::simple_message::ReplyType reply) |
creates a simple_message reply | |
virtual bool | toRequest (industrial::simple_message::SimpleMessage &msg) |
creates a simple_message request | |
virtual bool | toTopic (industrial::simple_message::SimpleMessage &msg) |
creates a simple_message topic | |
Protected Member Functions | |
void | setMessageType (int message_type=industrial::simple_message::StandardMsgTypes::INVALID) |
sets message type | |
Private Attributes | |
int | message_type_ |
Message type expected by callback. |
Message interface for typed messages built from SimpleMessage.
This is an interface for a helper class that when implemented is used to create simple messages of the various types (i.e. as defined by the message type enumeration). It also has constructors and initializers that can be used to create a typed message from a simple message.
If the typed message does not support a particular simple message type the "to" method should be overridden to return false. For exmaple, a ping message cannot be a topic, it is always expected to be a request/ reply. A joint trajectory point on the other hand may either be a topic (i.e. asynchronously sent) or a request/reply (i.e. syncrounously sent)
Classes that implement this interface shall include data members for the data payload of the typed message.
THIS CLASS IS NOT THREAD-SAFE
Definition at line 74 of file typed_message.h.
int industrial::typed_message::TypedMessage::getMessageType | ( | ) | const [inline] |
gets message type (enumeration)
Definition at line 137 of file typed_message.h.
virtual bool industrial::typed_message::TypedMessage::init | ( | industrial::simple_message::SimpleMessage & | msg | ) | [pure virtual] |
Initializes message from a simple message.
Implemented in industrial::joint_message::JointMessage, industrial::joint_feedback_message::JointFeedbackMessage, industrial::joint_traj_pt_full_message::JointTrajPtFullMessage, industrial::joint_traj_pt_message::JointTrajPtMessage, industrial::robot_status_message::RobotStatusMessage, and industrial::ping_message::PingMessage.
virtual void industrial::typed_message::TypedMessage::init | ( | ) | [pure virtual] |
Initializes a new empty message.
Implemented in industrial::joint_message::JointMessage, industrial::joint_feedback_message::JointFeedbackMessage, industrial::joint_traj_pt_full_message::JointTrajPtFullMessage, industrial::joint_traj_pt_message::JointTrajPtMessage, industrial::robot_status_message::RobotStatusMessage, and industrial::ping_message::PingMessage.
void industrial::typed_message::TypedMessage::setMessageType | ( | int | message_type = industrial::simple_message::StandardMsgTypes::INVALID | ) | [inline, protected] |
virtual bool industrial::typed_message::TypedMessage::toReply | ( | industrial::simple_message::SimpleMessage & | msg, |
industrial::simple_message::ReplyType | reply | ||
) | [inline, virtual] |
creates a simple_message reply
Definition at line 110 of file typed_message.h.
virtual bool industrial::typed_message::TypedMessage::toRequest | ( | industrial::simple_message::SimpleMessage & | msg | ) | [inline, virtual] |
creates a simple_message request
Definition at line 96 of file typed_message.h.
virtual bool industrial::typed_message::TypedMessage::toTopic | ( | industrial::simple_message::SimpleMessage & | msg | ) | [inline, virtual] |
creates a simple_message topic
Reimplemented in industrial::ping_message::PingMessage.
Definition at line 124 of file typed_message.h.
int industrial::typed_message::TypedMessage::message_type_ [private] |
Message type expected by callback.
Definition at line 160 of file typed_message.h.