#include <vetprot.h>
Inheritance diagram for cornelluniversity::vetserial::pubsub_message:
Public Member Functions | |||||||||||||
pubsub_message (void) | |||||||||||||
Default constructor Instantiates a default (i.e. message-less) message proxy command. You need to call set_message() before this will be of value. | |||||||||||||
pubsub_message (Message *m) | |||||||||||||
Overloaded constructor Accepts a Message struct that will be serialized for transport.
| |||||||||||||
pubsub_message (const uint8_ *in_pkt, uint32_ nbytes) | |||||||||||||
Overloaded constructor Accepts packet and packet size for deserialization purposes. | |||||||||||||
virtual | ~pubsub_message (void) | ||||||||||||
Destructor. | |||||||||||||
void | set_message (Message *m) | ||||||||||||
object mutator to set the message to be processed. | |||||||||||||
Message * | get_message (void) | ||||||||||||
object accessor to obtain a pointer to the current message (if it exists). If there is no message, we look in the buffer for a packet to deserialize. | |||||||||||||
const uint16_ | message_length (void) const | ||||||||||||
virtual void | serialize (void) | ||||||||||||
Overridden virtual function. Builds a stop request packet by instantiating a header, adding the payload, and capping it off with a trailer. The full packet is left in buffer for you to access via this->packet().
| |||||||||||||
virtual void | deserialize (void) | ||||||||||||
parses apart a received packet into the appropriate private members for use via the typical accessor process.
|
cornelluniversity::vetserial::pubsub_message::pubsub_message | ( | void | ) | [inline] |
Default constructor Instantiates a default (i.e. message-less) message proxy command. You need to call set_message() before this will be of value.
cornelluniversity::vetserial::pubsub_message::pubsub_message | ( | Message * | m | ) |
Overloaded constructor Accepts a Message struct that will be serialized for transport.
vetsim_exception | if the supplied Message is a null pointer | |
vetsim_exception | to rethrow std::bad_alloc. |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
cornelluniversity::vetserial::pubsub_message::pubsub_message | ( | const uint8_ * | in_pkt, | |
uint32_ | nbytes | |||
) | [inline] |
Overloaded constructor Accepts packet and packet size for deserialization purposes.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
virtual cornelluniversity::vetserial::pubsub_message::~pubsub_message | ( | void | ) | [virtual] |
Destructor.
virtual void cornelluniversity::vetserial::pubsub_message::deserialize | ( | void | ) | [virtual] |
parses apart a received packet into the appropriate private members for use via the typical accessor process.
cornelluniversity::vetsim_exception | if we are unable to discern the data type of the Message struct | |
cornelluniversity::vetsim_badchksum | if the crc validation fails | |
cornelluniversity::vetsim_exception | to rethrow std::bad_alloc | |
cornelluniversity::vetsim_exception | if packet_ buffer is empty (null pointer) |
Implements cornelluniversity::vetserial::base_command.
Message* cornelluniversity::vetserial::pubsub_message::get_message | ( | void | ) |
object accessor to obtain a pointer to the current message (if it exists). If there is no message, we look in the buffer for a packet to deserialize.
vetsim_exception | in the event that there is neither a message nor a packet to deserialize | |
vetsim_exception | to rethrow std::bad_alloc |
const uint16_ cornelluniversity::vetserial::pubsub_message::message_length | ( | void | ) | const [inline] |
virtual void cornelluniversity::vetserial::pubsub_message::serialize | ( | void | ) | [virtual] |
Overridden virtual function. Builds a stop request packet by instantiating a header, adding the payload, and capping it off with a trailer. The full packet is left in buffer for you to access via this->packet().
std::bad_alloc | standard memory allocation failure | |
vetsim_exception | in the event that we cannot discern the type for the void pointer. |
Implements cornelluniversity::vetserial::base_command.
void cornelluniversity::vetserial::pubsub_message::set_message | ( | Message * | m | ) |
object mutator to set the message to be processed.
m | - pointer to a Message struct |
vetsim_exception | if the supplied Message is a null pointer | |
vetsim_exception | to rethrow std::bad_alloc |