Sequence data type. More...
Public Member Functions | |
sequence () | |
construct an empty sequence | |
sequence (const sequence &x) | |
copy constructor Copies sequence contents. | |
~sequence () | |
destroy the sequence and release resources. Destroys sequence contents. | |
sequence & | operator= (const sequence &x) |
assignment operator Copies seqeuence contents. | |
uint32_t | size () const |
Returns the current size (number of elements) of the sequence. | |
uint32_t | capacity () const |
Returns the current capacity (number of elements) of the sequence. The equation "size <= capacity" is always true. | |
void | reserve (uint32_t n) |
Set the capacity of the sequence. | |
void | resize (uint32_t n) |
Set the 'capacity' and 'size' of the sequence. | |
bool | empty () const |
test if the sequence is empty | |
void | shrink_to_fit () |
reduce 'capacity' to match 'size' | |
T & | operator[] (uint32_t n) |
const T & | operator[] (uint32_t n) const |
T & | at (uint32_t n) |
const T & | at (uint32_t n) const |
T & | front () |
const T & | front () const |
T & | back () |
const T & | back () const |
void | push_back (const T &v) |
void | pop_back () |
void | swap (sequence &x) |
void | clear () |
Sequence data type.
Provides an implementation of the Sequence data type. This data type is used in a few places throughout the DDS API.
It is most prevelant in the DataReader API where it is used to return a collection of samples and SampleInfo items back to the caller.
It is also used in a few QoS Policies.
const T & DDS::sequence< T >::at | ( | uint32_t | n | ) | const [inline] |
access an element
T & DDS::sequence< T >::at | ( | uint32_t | n | ) | [inline] |
access an element
const T & DDS::sequence< T >::back | ( | ) | const [inline] |
access the last element
T & DDS::sequence< T >::back | ( | ) | [inline] |
access the last element
void DDS::sequence< T >::clear | ( | ) | [inline] |
clear the contents of this sequence
const T & DDS::sequence< T >::front | ( | ) | const [inline] |
access the first element
T & DDS::sequence< T >::front | ( | ) | [inline] |
access the first element
const T & DDS::sequence< T >::operator[] | ( | uint32_t | n | ) | const [inline] |
access an element
T & DDS::sequence< T >::operator[] | ( | uint32_t | n | ) | [inline] |
access an element
void DDS::sequence< T >::pop_back | ( | ) | [inline] |
reduce 'size' by one
void DDS::sequence< T >::push_back | ( | const T & | v | ) | [inline] |
add an element after the last Increments 'size' (and possibly 'capacity') if requried.
void DDS::sequence< T >::reserve | ( | uint32_t | n | ) | [inline] |
Set the capacity of the sequence.
If n is larger than current capacity, then the capacity is increased to 'n'. If 'n' is smaller than current capacity, then the capacity is reduced to 'n'. If capacity is reduced below 'size', then 'size' will be reduced to match 'capacity'. In the case of a reduction in 'size', the elimitated elements will be destroyed.
void DDS::sequence< T >::resize | ( | uint32_t | n | ) | [inline] |
Set the 'capacity' and 'size' of the sequence.
If n is larger than current capacity, then the capacity is increased to 'n'. If 'n' is smaller than current capacity, then the capacity is reduced to 'n'. If capacity is reduced below 'size', then 'size' will be reduced to match 'capacity'. In the case of a reduction in 'size', the elimitated elements will be destroyed.
void DDS::sequence< T >::swap | ( | sequence< T > & | x | ) | [inline] |
swap the contents of this sequence with that of another