CoreDX DDS
C++ Reference Manual

DDS::sequence< T > Class Template Reference

Sequence data type. More...

List of all members.

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

Detailed Description

template<class T>
class DDS::sequence< T >

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.


Member Function Documentation

template<class T >
const T & DDS::sequence< T >::at ( uint32_t  n  )  const [inline]

access an element

template<class T >
T & DDS::sequence< T >::at ( uint32_t  n  )  [inline]

access an element

template<class T >
const T & DDS::sequence< T >::back (  )  const [inline]

access the last element

template<class T >
T & DDS::sequence< T >::back (  )  [inline]

access the last element

template<class T >
void DDS::sequence< T >::clear (  )  [inline]

clear the contents of this sequence

template<class T >
const T & DDS::sequence< T >::front (  )  const [inline]

access the first element

template<class T >
T & DDS::sequence< T >::front (  )  [inline]

access the first element

template<class T >
const T & DDS::sequence< T >::operator[] ( uint32_t  n  )  const [inline]

access an element

template<class T >
T & DDS::sequence< T >::operator[] ( uint32_t  n  )  [inline]

access an element

template<class T >
void DDS::sequence< T >::pop_back (  )  [inline]

reduce 'size' by one

template<class T >
void DDS::sequence< T >::push_back ( const T &  v  )  [inline]

add an element after the last Increments 'size' (and possibly 'capacity') if requried.

template<class T >
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.

template<class T >
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.

template<class T >
void DDS::sequence< T >::swap ( sequence< T > &  x  )  [inline]

swap the contents of this sequence with that of another

 All Classes Files Functions Variables

© 2009-2013 Twin Oaks Computing, Inc
Castle Rock, CO 80108
All rights reserved.