Public Member Functions | List of all members
industrial::ping_message::PingMessage Class Reference

Class encapsulated ping message generation methods (either to or from a SimpleMessage type. More...

#include <ping_message.h>

Inheritance diagram for industrial::ping_message::PingMessage:
Inheritance graph
[legend]

Public Member Functions

unsigned int byteLength ()
 Virtual method returns the object size when packed into a ByteArray. More...
 
void init ()
 Initializes a new ping message. More...
 
bool init (industrial::simple_message::SimpleMessage &msg)
 Initializes message from a simple message. More...
 
bool load (industrial::byte_array::ByteArray *buffer)
 Virtual method for loading an object into a ByteArray. More...
 
 PingMessage (void)
 Default constructor. More...
 
bool toTopic (industrial::simple_message::SimpleMessage &msg)
 The ping message overrides the base method toTopic to always return false. A ping cannot be sent as a topic. More...
 
bool unload (industrial::byte_array::ByteArray *buffer)
 Virtual method for unloading an object from a ByteArray. More...
 
 ~PingMessage (void)
 Destructor. More...
 
- Public Member Functions inherited from industrial::typed_message::TypedMessage
int getCommType () const
 Gets the communication type of the message. More...
 
int getMessageType () const
 gets message type (enumeration) 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...
 

Additional Inherited Members

- Protected Member Functions inherited from industrial::typed_message::TypedMessage
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...
 

Detailed Description

Class encapsulated ping message generation methods (either to or from a SimpleMessage type.

THIS CLASS IS NOT THREAD-SAFE

Definition at line 60 of file ping_message.h.

Constructor & Destructor Documentation

◆ PingMessage()

industrial::ping_message::PingMessage::PingMessage ( void  )

Default constructor.

This method creates an empty byte ping message.

Definition at line 50 of file ping_message.cpp.

◆ ~PingMessage()

industrial::ping_message::PingMessage::~PingMessage ( void  )

Destructor.

Definition at line 55 of file ping_message.cpp.

Member Function Documentation

◆ byteLength()

unsigned int industrial::ping_message::PingMessage::byteLength ( )
inlinevirtual

Virtual method returns the object size when packed into a ByteArray.

Returns
object size (in bytes)

Implements industrial::simple_serialize::SimpleSerialize.

Definition at line 104 of file ping_message.h.

◆ init() [1/2]

void industrial::ping_message::PingMessage::init ( )
virtual

Initializes a new ping message.

Implements industrial::typed_message::TypedMessage.

Definition at line 80 of file ping_message.cpp.

◆ init() [2/2]

bool industrial::ping_message::PingMessage::init ( industrial::simple_message::SimpleMessage msg)
virtual

Initializes message from a simple message.

Returns
true if message successfully initialized, otherwise false

Implements industrial::typed_message::TypedMessage.

Definition at line 61 of file ping_message.cpp.

◆ load()

bool industrial::ping_message::PingMessage::load ( industrial::byte_array::ByteArray buffer)
inlinevirtual

Virtual method for loading an object into a ByteArray.

This method should load all the required data to reconstruct the class object into the buffer

Parameters
bufferpointer to ByteArray
Returns
true on success, false otherwise (buffer not large enough)

Implements industrial::simple_serialize::SimpleSerialize.

Definition at line 102 of file ping_message.h.

◆ toTopic()

bool industrial::ping_message::PingMessage::toTopic ( industrial::simple_message::SimpleMessage msg)
inlinevirtual

The ping message overrides the base method toTopic to always return false. A ping cannot be sent as a topic.

Reimplemented from industrial::typed_message::TypedMessage.

Definition at line 96 of file ping_message.h.

◆ unload()

bool industrial::ping_message::PingMessage::unload ( industrial::byte_array::ByteArray buffer)
inlinevirtual

Virtual method for unloading an object from a ByteArray.

This method should unload all the required data to reconstruct the class object (in place)

Parameters
bufferpointer to ByteArray
Returns
true on success, false otherwise (buffer not large enough)

Implements industrial::simple_serialize::SimpleSerialize.

Definition at line 103 of file ping_message.h.


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


simple_message
Author(s): Shaun Edwards
autogenerated on Wed Mar 2 2022 00:24:53