Public Member Functions | Protected Member Functions | Private Attributes | List of all members
industrial::typed_message::TypedMessage Class Referenceabstract

Message interface for typed messages built from SimpleMessage. More...

#include <typed_message.h>

Inheritance diagram for industrial::typed_message::TypedMessage:
Inheritance graph
[legend]

Public Member Functions

int getCommType () const
 Gets the communication type of the message. More...
 
int getMessageType () const
 gets message type (enumeration) More...
 
virtual bool init (industrial::simple_message::SimpleMessage &msg)=0
 Initializes message from a simple message. More...
 
virtual void init ()=0
 Initializes a new empty 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...
 

Detailed Description

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.

Deprecated:
The base function implementations in the class will be removed in a later release. This will force classes that inherit from this class to implement them.

THIS CLASS IS NOT THREAD-SAFE

Definition at line 74 of file typed_message.h.

Member Function Documentation

int industrial::typed_message::TypedMessage::getCommType ( ) const
inline

Gets the communication type of the message.

Returns
the value of the comm_type parameter (refer to simple_message::CommTypes::CommType)

Definition at line 147 of file typed_message.h.

int industrial::typed_message::TypedMessage::getMessageType ( ) const
inline

gets message type (enumeration)

Returns
message type

Definition at line 137 of file typed_message.h.

virtual bool industrial::typed_message::TypedMessage::init ( industrial::simple_message::SimpleMessage msg)
pure virtual
virtual void industrial::typed_message::TypedMessage::init ( )
pure virtual
void industrial::typed_message::TypedMessage::setCommType ( int  comm_type = industrial::simple_message::CommTypes::INVALID)
inlineprotected

Sets the communication type of the message.

Parameters
comm_typevalue of the comm_type parameter (refer to simple_message::CommTypes::CommType)

Definition at line 169 of file typed_message.h.

void industrial::typed_message::TypedMessage::setMessageType ( int  message_type = industrial::simple_message::StandardMsgTypes::INVALID)
inlineprotected

sets message type

Returns
message type

Definition at line 159 of file typed_message.h.

virtual bool industrial::typed_message::TypedMessage::toReply ( industrial::simple_message::SimpleMessage msg,
industrial::simple_message::ReplyType  reply 
)
inlinevirtual

creates a simple_message reply

Returns
true if message successfully initialized, otherwise false

Definition at line 110 of file typed_message.h.

virtual bool industrial::typed_message::TypedMessage::toRequest ( industrial::simple_message::SimpleMessage msg)
inlinevirtual

creates a simple_message request

Returns
true if message successfully initialized, otherwise false

Definition at line 96 of file typed_message.h.

virtual bool industrial::typed_message::TypedMessage::toTopic ( industrial::simple_message::SimpleMessage msg)
inlinevirtual

creates a simple_message topic

Returns
true if message successfully initialized, otherwise false

Reimplemented in industrial::ping_message::PingMessage.

Definition at line 124 of file typed_message.h.

Member Data Documentation

int industrial::typed_message::TypedMessage::comm_type_
private

Communications type (see simple_message::CommTypes::CommType)

Definition at line 185 of file typed_message.h.

int industrial::typed_message::TypedMessage::message_type_
private

Message type expected by callback.

Definition at line 180 of file typed_message.h.


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


simple_message
Author(s): Shaun Edwards
autogenerated on Sat Sep 21 2019 03:30:09