cornelluniversity::vetserial::cpr_compression_state Class Reference

device to pc : chest compression stat notification More...

#include <vetprot.h>

Inheritance diagram for cornelluniversity::vetserial::cpr_compression_state:

cornelluniversity::vetserial::base_command List of all members.

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.
Exceptions:
vetsim_exception to rethrow std::bad_alloc.

 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.
Exceptions:
vetsim_exception to rethrow std::bad_alloc.

 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.
Exceptions:
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)


Detailed Description

device to pc : chest compression stat notification

base_command


Constructor & Destructor Documentation

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.

See also:
cpr_compression_state( const uint16_ position )

cpr_compression_state( const uint16_ * cpy, const int arraysz );

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.

Exceptions:
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.

See also:
pubsub_message( void )

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.

Exceptions:
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.

See also:
pubsub_message( void )

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.


Member Function Documentation

const std::queue<uint16_>* cornelluniversity::vetserial::cpr_compression_state::all_positions ( void   )  const [inline]

Accessor to the internally mainatined queue of compression data.

Returns:
std::queue<int16_>* - const pointer to the internal data queue

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.

Exceptions:
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.

Parameters:
po_position - boolean value indicating whether or not to pop the front value off the queue after delivering it to you.
Returns:
uint16_ - compression positional data from the front of thee queue

void cornelluniversity::vetserial::cpr_compression_state::position ( const uint16_ cpy,
const int  arraysz 
)

Mutator allowing for additions to the positional vector.

Parameters:
cpy - pointer to an array of compression positional data in uint16_ format
arraysz - integer value indicating the number of elements in the array
Exceptions:
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.

Parameters:
pos - compression positional data in uint16_ format
Exceptions:
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).

Returns:
size_t - number of data elements currently in the queue

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().

Warning:
the act of serialization empties the queue
Exceptions:
std::bad_alloc standard memory allocation failure

Implements cornelluniversity::vetserial::base_command.


The documentation for this class was generated from the following file:
Generated on Wed Nov 14 12:01:02 2012 for VetSim Applications by  doxygen 1.4.7