Message interface for typed messages built from SimpleMessage. More...
#include <typed_message.h>
Public Member Functions | |
int | getCommType () const |
Gets the communication type of the message. More... | |
int | getMessageType () const |
gets message type (enumeration) More... | |
virtual void | init ()=0 |
Initializes a new empty message. More... | |
virtual bool | init (industrial::simple_message::SimpleMessage &msg)=0 |
Initializes message from a simple message. More... | |
virtual bool | toReply (industrial::simple_message::SimpleMessage &msg, industrial::simple_message::ReplyType reply) |
creates a simple_message reply More... | |
virtual bool | toRequest (industrial::simple_message::SimpleMessage &msg) |
creates a simple_message request More... | |
virtual bool | toTopic (industrial::simple_message::SimpleMessage &msg) |
creates a simple_message topic More... | |
Public Member Functions inherited from industrial::simple_serialize::SimpleSerialize | |
virtual unsigned int | byteLength ()=0 |
Virtual method returns the object size when packed into a ByteArray. More... | |
virtual bool | load (industrial::byte_array::ByteArray *buffer)=0 |
Virtual method for loading an object into a ByteArray. More... | |
virtual bool | unload (industrial::byte_array::ByteArray *buffer)=0 |
Virtual method for unloading an object from a ByteArray. More... | |
Protected Member Functions | |
void | setCommType (int comm_type=industrial::simple_message::CommTypes::INVALID) |
Sets the communication type of the message. More... | |
void | setMessageType (int message_type=industrial::simple_message::StandardMsgTypes::INVALID) |
sets message type More... | |
Private Attributes | |
int | comm_type_ |
Communications type (see simple_message::CommTypes::CommType) More... | |
int | message_type_ |
Message type expected by callback. More... | |
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.
|
inline |
Gets the communication type of the message.
Definition at line 147 of file typed_message.h.
|
inline |
|
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.
|
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.
|
inlineprotected |
Sets the communication type of the message.
comm_type | value of the comm_type parameter (refer to simple_message::CommTypes::CommType) |
Definition at line 169 of file typed_message.h.
|
inlineprotected |
|
inlinevirtual |
creates a simple_message reply
Definition at line 110 of file typed_message.h.
|
inlinevirtual |
creates a simple_message request
Definition at line 96 of file typed_message.h.
|
inlinevirtual |
creates a simple_message topic
Reimplemented in industrial::ping_message::PingMessage.
Definition at line 124 of file typed_message.h.
|
private |
Communications type (see simple_message::CommTypes::CommType)
Definition at line 185 of file typed_message.h.
|
private |
Message type expected by callback.
Definition at line 180 of file typed_message.h.