ERC CISST - cisst software

mtsStateArray< _elementType > Class Template Reference
[Multi Task Support]

#include <mtsStateArray.h>

Inheritance diagram for mtsStateArray< _elementType >:

Inheritance graph
[legend]
Collaboration diagram for mtsStateArray< _elementType >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class _elementType>
class mtsStateArray< _elementType >

Individual state array classes can be created from an instance of the following template, where _elementType represents the type of data used by the particular state element. It is assumed that _elementType is derived from mtsGenericObject.

Definition at line 49 of file mtsStateArray.h.

Public Types

Public Member Functions

Protected Attributes


Constructor & Destructor Documentation

template<class _elementType>
mtsStateArray< _elementType >::mtsStateArray ( const value_type objectExample,
size_type  size = 0 
) [inline]

Default constructor. Does nothing

Definition at line 65 of file mtsStateArray.h.

template<class _elementType>
virtual mtsStateArray< _elementType >::~mtsStateArray (  )  [inline, virtual]

Default destructor.

Definition at line 72 of file mtsStateArray.h.


Member Function Documentation

template<class _elementType>
const value_type& mtsStateArray< _elementType >::Element ( index_type  index  )  const [inline]

Access element at index. This returns the data of the derived type (value_type) rather than the base type (mtsGenericObject), which is returned by the overloaded operator [].

Definition at line 77 of file mtsStateArray.h.

template<class _elementType>
mtsGenericObject& mtsStateArray< _elementType >::operator[] ( index_type  index  )  [inline, virtual]

Overloaded [] operator. Returns data at index (of type mtsGenericObject). Currently used for data collection (mtsCollectorState).

Implements mtsStateArrayBase.

Definition at line 82 of file mtsStateArray.h.

template<class _elementType>
const mtsGenericObject& mtsStateArray< _elementType >::operator[] ( index_type  index  )  const [inline, virtual]

Overloaded subscript operator.

Implements mtsStateArrayBase.

Definition at line 83 of file mtsStateArray.h.

template<class _elementType>
mtsStateArrayBase* mtsStateArray< _elementType >::Create ( const mtsGenericObject objectExample,
size_type  size 
) [inline, virtual]

Create the array of data. This is currently unused.

Implements mtsStateArrayBase.

Definition at line 86 of file mtsStateArray.h.

template<class _elementType>
void mtsStateArray< _elementType >::Copy ( index_type  indexTo,
index_type  indexFrom 
) [inline, virtual]

Copy data from one index to another within the same array.

Implements mtsStateArrayBase.

Definition at line 106 of file mtsStateArray.h.

template<class _elementType>
bool mtsStateArray< _elementType >::Get ( index_type  index,
mtsGenericObject object 
) const [virtual]

Get and Set data from array. The Get and Set member functions deserve special mention because they must overcome a limitation of C++ -- namely, that it does not fully support containers of heterogeneous objects. In particular, we expect the 'object' parameter to be of type _elementType& (the derived class) rather than mtsGenericObject& (the base class). This can be handled using C++ Run Time Type Information (RTTI) features such as dynamic cast.

Implements mtsStateArrayBase.

Definition at line 154 of file mtsStateArray.h.

References CMN_LOG_RUN_ERROR, and mtsStateArray< _elementType >::Data.

template<class _elementType>
bool mtsStateArray< _elementType >::Set ( index_type  index,
const mtsGenericObject object 
) [virtual]

Get and Set data from array. The Get and Set member functions deserve special mention because they must overcome a limitation of C++ -- namely, that it does not fully support containers of heterogeneous objects. In particular, we expect the 'object' parameter to be of type _elementType& (the derived class) rather than mtsGenericObject& (the base class). This can be handled using C++ Run Time Type Information (RTTI) features such as dynamic cast.

Implements mtsStateArrayBase.

Definition at line 133 of file mtsStateArray.h.

References CMN_LOG_RUN_ERROR, and mtsStateArray< _elementType >::Data.

template<class _elementType>
bool mtsStateArray< _elementType >::GetHistory ( index_type  indexStart,
index_type  indexEnd,
mtsHistory< _elementType > &  data 
) const [virtual]

Get data vector from array.

Definition at line 165 of file mtsStateArray.h.

References CMN_LOG_INIT_ERROR, mtsStateArray< _elementType >::Data, and vctDynamicConstVectorBase< vctDynamicVectorOwner< _elementType >, _elementType >::size().


Member Data Documentation

template<class _elementType>
VectorType mtsStateArray< _elementType >::Data [protected]

A vector to store the data. These element of the vector represents the cell of the state data table.

Definition at line 61 of file mtsStateArray.h.

Referenced by mtsStateArray< mtsGenericObjectProxyFinalType >::Copy(), mtsStateArray< mtsGenericObjectProxyFinalType >::Create(), mtsStateArray< mtsGenericObjectProxyFinalType >::Element(), mtsStateArray< _elementType >::Get(), mtsStateArray< _elementType >::GetHistory(), mtsStateArray< mtsGenericObjectProxyFinalType >::operator[](), and mtsStateArray< _elementType >::Set().


The documentation for this class was generated from the following file:
erc-cisst-devel<at>lists.johnshopkins.edu