cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | List of all members
vctDynamicVectorBase< _vectorOwnerType, _elementType >::Subvector Class Reference

#include <vctDynamicVectorBase.h>

Public Types

typedef vctDynamicVectorRef
< value_type > 
Type
 

Detailed Description

template<class _vectorOwnerType, typename _elementType>
class vctDynamicVectorBase< _vectorOwnerType, _elementType >::Subvector

Define a Subvector class for compatibility with the fixed size vectors. A subvector has the same stride as the parent container.

Example:

typedef vctDynamicVector<double> VectorType; VectorType v(9); VectorType::Subvector::Type first4(v, 0, 4); VectorType::Subvector::Type last5(v, 4, 5);

Note
There is no straightforward way to define a fixed-size subvector of a dynamic vector, because the stride of the dynamic vector is not known in compilation time. A way to do it is:

vctFixedSizeVectorRef<double, 3 /( add stride here if necessary )/> firstThree(v, 0); vctFixedSizeVectorRef<double, 3 /( add stride here if necessary )/> lastThree(v, 6);

Member Typedef Documentation

template<class _vectorOwnerType, typename _elementType>
typedef vctDynamicVectorRef<value_type> vctDynamicVectorBase< _vectorOwnerType, _elementType >::Subvector::Type

The documentation for this class was generated from the following file: