#include <vetprot.h>
Inheritance diagram for cornelluniversity::vetserial::cpr_compression_state:
Public Member Functions | |||||||||||||
cpr_compression_state (void) | |||||||||||||
Default constructor Instantiates a default object with no stored data. memory is allocated for the vector. | |||||||||||||
cpr_compression_state (const uint16_ pos) | |||||||||||||
Overloaded constructor Accepts an initial compression position value which is stored in the vector after it is initialized.
| |||||||||||||
cpr_compression_state (const uint16_ *cpy, const int arraysz) | |||||||||||||
Overloaded constructor Accepts an array of compression positional values which are copied over to the local vector after it's memory is allocated.
| |||||||||||||
cpr_compression_state (const uint8_ *in_pkt, uint32_ nbytes) | |||||||||||||
Overloaded constructor Accepts packet and packet size for deserialization purposes. | |||||||||||||
virtual | ~cpr_compression_state (void) | ||||||||||||
Destructor. | |||||||||||||
void | position (const uint16_ pos) | ||||||||||||
Mutator allowing for additions to the positional vector. | |||||||||||||
void | position (const int pos) | ||||||||||||
void | position (const uint16_ *cpy, const int arraysz) | ||||||||||||
Mutator allowing for additions to the positional vector. | |||||||||||||
const uint16_ | position (const bool pop_position=false) | ||||||||||||
Accessor to the positional data. By default, the first value received will be returned to you in a typical FIFO approach. This is sort of a peek, the data will not change and would be returned to you in subsquent requests. If you pass true via the arg, then the first value will be returned to you and removed from the queue. | |||||||||||||
const std::queue< uint16_ > * | all_positions (void) const | ||||||||||||
Accessor to the internally mainatined queue of compression data. | |||||||||||||
const size_t | position_count (void) const | ||||||||||||
Accessor to the internally maintained data queue's size (data count). | |||||||||||||
virtual void | serialize (void) | ||||||||||||
Overridden virtual function. Builds a cpr compression notice 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(). | |||||||||||||
void | deserialize (void) | ||||||||||||
parses apart a received packet into the appropriate private members for use via the typical accessor process.
|
cornelluniversity::vetserial::cpr_compression_state::cpr_compression_state | ( | void | ) |
Default constructor Instantiates a default object with no stored data. memory is allocated for the vector.
cornelluniversity::vetserial::cpr_compression_state::cpr_compression_state | ( | const uint16_ | pos | ) |
Overloaded constructor Accepts an initial compression position value which is stored in the vector after it is initialized.
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::cpr_compression_state::cpr_compression_state | ( | const uint16_ * | cpy, | |
const int | arraysz | |||
) |
Overloaded constructor Accepts an array of compression positional values which are copied over to the local vector after it's memory is allocated.
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::cpr_compression_state::cpr_compression_state | ( | const uint8_ * | in_pkt, | |
uint32_ | nbytes | |||
) |
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::cpr_compression_state::~cpr_compression_state | ( | void | ) | [inline, virtual] |
Destructor.
const std::queue<uint16_>* cornelluniversity::vetserial::cpr_compression_state::all_positions | ( | void | ) | const [inline] |
Accessor to the internally mainatined queue of compression data.
void cornelluniversity::vetserial::cpr_compression_state::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 end up with more/less data than the packet reported. | |
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.
const uint16_ cornelluniversity::vetserial::cpr_compression_state::position | ( | const bool | pop_position = false |
) |
Accessor to the positional data. By default, the first value received will be returned to you in a typical FIFO approach. This is sort of a peek, the data will not change and would be returned to you in subsquent requests. If you pass true via the arg, then the first value will be returned to you and removed from the queue.
po_position | - boolean value indicating whether or not to pop the front value off the queue after delivering it to you. |
void cornelluniversity::vetserial::cpr_compression_state::position | ( | const uint16_ * | cpy, | |
const int | arraysz | |||
) |
Mutator allowing for additions to the positional vector.
cpy | - pointer to an array of compression positional data in uint16_ format | |
arraysz | - integer value indicating the number of elements in the array |
vetsim_exception | in the event that the positions_ vector is unallocated |
void cornelluniversity::vetserial::cpr_compression_state::position | ( | const int | pos | ) | [inline] |
void cornelluniversity::vetserial::cpr_compression_state::position | ( | const uint16_ | pos | ) |
Mutator allowing for additions to the positional vector.
pos | - compression positional data in uint16_ format |
vetsim_exception | in the event that the positions_ vector is unallocated |
const size_t cornelluniversity::vetserial::cpr_compression_state::position_count | ( | void | ) | const [inline] |
Accessor to the internally maintained data queue's size (data count).
virtual void cornelluniversity::vetserial::cpr_compression_state::serialize | ( | void | ) | [virtual] |
Overridden virtual function. Builds a cpr compression notice 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 |
Implements cornelluniversity::vetserial::base_command.