cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | List of all members
vctDynamicVectorRef< _elementType > Class Template Reference

Dynamic vector referencing existing memory. More...

#include <vctDynamicVectorRef.h>

Inheritance diagram for vctDynamicVectorRef< _elementType >:
vctDynamicVectorBase< vctDynamicVectorRefOwner< _elementType >, _elementType > vctDynamicConstVectorBase< vctDynamicVectorRefOwner< _elementType >, _elementType >

Public Types

typedef vctDynamicVectorRef
< _elementType > 
ThisType
 
typedef
vctDynamicVectorRefOwner
< _elementType > 
VectorOwnerType
 
typedef vctDynamicVectorBase
< vctDynamicVectorRefOwner
< _elementType >, _elementType > 
BaseType
 
typedef BaseType::CopyType CopyType
 
typedef VectorOwnerType::iterator iterator
 
typedef
VectorOwnerType::const_iterator 
const_iterator
 
typedef
VectorOwnerType::reverse_iterator 
reverse_iterator
 
typedef
VectorOwnerType::const_reverse_iterator 
const_reverse_iterator
 
- Public Types inherited from vctDynamicVectorBase< vctDynamicVectorRefOwner< _elementType >, _elementType >
typedef vctDynamicVectorBase ThisType
 
typedef
vctDynamicConstVectorBase
< vctDynamicVectorRefOwner
< _elementType >, _elementType > 
BaseType
 
typedef
vctDynamicVectorRefOwner
< _elementType > 
VectorOwnerType
 
typedef BaseType::iterator iterator
 
typedef BaseType::reverse_iterator reverse_iterator
 
typedef BaseType::const_iterator const_iterator
 
typedef
BaseType::const_reverse_iterator 
const_reverse_iterator
 
typedef BaseType::CopyType CopyType
 
typedef BaseType::VectorValueType VectorValueType
 
typedef class cmnTypeTraits
< value_type > 
TypeTraits
 
typedef TypeTraits::VaArgPromotion ElementVaArgPromotion
 
- Public Types inherited from vctDynamicConstVectorBase< vctDynamicVectorRefOwner< _elementType >, _elementType >
typedef
vctDynamicConstVectorBase
< vctDynamicVectorRefOwner
< _elementType >, _elementType > 
ThisType
 
typedef
vctDynamicVectorRefOwner
< _elementType > 
OwnerType
 
typedef OwnerType::iterator iterator
 
typedef OwnerType::const_iterator const_iterator
 
typedef OwnerType::reverse_iterator reverse_iterator
 
typedef
OwnerType::const_reverse_iterator 
const_reverse_iterator
 
typedef vctDynamicVector
< _elementType > 
CopyType
 
typedef vctDynamicVector
< _elementType > 
VectorValueType
 
typedef vctDynamicVector
< _elementType > 
VectorReturnType
 
typedef cmnTypeTraits< value_type > TypeTraits
 
typedef TypeTraits::BoolType BoolType
 
typedef vctReturnDynamicVector
< BoolType
BoolVectorReturnType
 

Public Member Functions

 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
 vctDynamicVectorRef ()
 
 vctDynamicVectorRef (const ThisType &other)
 
 vctDynamicVectorRef (size_type size, value_type *data, stride_type stride=1)
 
template<size_type __size, stride_type __stride, class __dataPtrType >
 vctDynamicVectorRef (vctFixedSizeVectorBase< __size, __stride, _elementType, __dataPtrType > &otherVector, size_type startPosition=0)
 
template<size_type __size, stride_type __stride, class __dataPtrType >
 vctDynamicVectorRef (vctFixedSizeVectorBase< __size, __stride, _elementType, __dataPtrType > &otherVector, size_type startPosition, size_type length)
 
template<class __vectorOwnerType >
 vctDynamicVectorRef (vctDynamicVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
template<class __vectorOwnerType >
 vctDynamicVectorRef (vctDynamicVectorBase< __vectorOwnerType, _elementType > &otherVector, size_type startPosition, size_type length)
 
void SetRef (size_type size, pointer data, stride_type stride=1)
 
template<size_type __size, stride_type __stride, class __dataPtrType >
void SetRef (vctFixedSizeVectorBase< __size, __stride, _elementType, __dataPtrType > &otherVector, size_type startPosition=0)
 
template<size_type __size, stride_type __stride, class __dataPtrType >
void SetRef (vctFixedSizeVectorBase< __size, __stride, _elementType, __dataPtrType > &otherVector, size_type startPosition, size_type length) throw (std::out_of_range)
 
template<class __vectorOwnerType >
void SetRef (vctDynamicVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
template<class __vectorOwnerType >
void SetRef (vctDynamicVectorBase< __vectorOwnerType, _elementType > &otherVector, size_type startPosition, size_type length) throw (std::out_of_range)
 
ThisTypeoperator= (const value_type &value)
 
void DeSerializeRaw (std::istream &inputStream) throw (std::runtime_error)
 
ThisTypeoperator= (const ThisType &other)
 
ThisTypeoperator= (const vctDynamicConstVectorRef< value_type > &other)
 
template<class __vectorOwnerType , typename __elementType >
ThisTypeoperator= (const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &other)
 
template<size_type __size, stride_type __stride, class __elementType , class __dataPtrType >
ThisTypeoperator= (const vctFixedSizeConstVectorBase< __size, __stride, __elementType, __dataPtrType > &other)
 
- Public Member Functions inherited from vctDynamicVectorBase< vctDynamicVectorRefOwner< _elementType >, _elementType >
 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
iterator begin (void)
 
const_iterator begin (void) const
 
iterator end (void)
 
const_iterator end (void) const
 
reverse_iterator rbegin (void)
 
const_reverse_iterator rbegin (void) const
 
reverse_iterator rend (void)
 
const_reverse_iterator rend (void) const
 
reference operator[] (index_type index)
 
const_reference operator[] (index_type index) const
 
const VectorOwnerTypeOwner (void) const
 
VectorOwnerTypeOwner (void)
 
pointer Pointer (index_type index=0)
 
const_pointer Pointer (index_type index=0) const
 
reference at (index_type index) throw (std::out_of_range)
 
const_reference at (index_type index) const throw (std::out_of_range)
 
reference operator() (index_type index) throw (std::out_of_range)
 
const_reference operator() (index_type index) const throw (std::out_of_range)
 
reference Element (index_type index)
 
const_reference Element (index_type index) const
 
value_type SetAll (const value_type value)
 
bool Zeros (void)
 
ThisTypeAssign (const value_type *elements)
 
ThisTypeAssign (value_type element0, value_type element1,...) throw (std::runtime_error)
 
ThisTypeConcatenationOf (const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &otherVector, __elementType lastElement)
 
void SelectFrom (const vctDynamicConstVectorBase< __inputVectorOwner, _elementType > &input, const vctDynamicConstVectorBase< __indexVectorOwner, index_type > &index)
 
void CrossProductOf (const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &inputVector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &inputVector2)
 
ThisTypeAddProductOf (const value_type scalar, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeAddElementwiseProductOf (const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
 
ThisTypeAssign (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &other)
 
ThisTypeAssign (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &other, size_type length, size_type startPositionThis=0, size_type startPositionOther=0)
 
ThisTypeAssign (const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &other)
 
ThisTypeAssign (const vctFixedSizeConstVectorBase< __size, __stride, __elementType, __dataPtrType > &other)
 
ThisTypeoperator= (const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &other)
 
ThisTypeForceAssign (const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &other)
 
ThisTypeForceAssign (const vctFixedSizeConstVectorBase< __size, __stride, __elementType, __dataPtrType > &other)
 
bool FastCopyOf (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &source, bool performSafetyChecks=true) throw (std::runtime_error)
 
bool FastCopyOf (const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > &source, bool performSafetyChecks=true) throw (std::runtime_error)
 
value_type & X (void)
 
const value_type & X (void) const
 
value_type & Y (void)
 
const value_type & Y (void) const
 
value_type & Z (void)
 
const value_type & Z (void) const
 
value_type & W (void)
 
const value_type & W (void) const
 
vctDynamicVectorRef< _elementType > XY (void)
 
vctDynamicConstVectorRef
< _elementType > 
XY (void) const
 
vctDynamicVectorRef< _elementType > XZ (void)
 
vctDynamicConstVectorRef
< _elementType > 
XZ (void) const
 
vctDynamicVectorRef< _elementType > XW (void)
 
vctDynamicConstVectorRef
< _elementType > 
XW (void) const
 
vctDynamicVectorRef< _elementType > YZ (void)
 
vctDynamicConstVectorRef
< _elementType > 
YZ (void) const
 
vctDynamicVectorRef< _elementType > YW (void)
 
vctDynamicConstVectorRef
< _elementType > 
YW (void) const
 
vctDynamicVectorRef< _elementType > ZW (void)
 
vctDynamicConstVectorRef
< _elementType > 
ZW (void) const
 
vctDynamicVectorRef< _elementType > XYZ (void)
 
vctDynamicConstVectorRef
< _elementType > 
XYZ (void) const
 
vctDynamicVectorRef< _elementType > YZW (void)
 
vctDynamicConstVectorRef
< _elementType > 
YZW (void) const
 
vctDynamicVectorRef< _elementType > XYZW (void)
 
vctDynamicConstVectorRef
< _elementType > 
XYZW (void) const
 
vctDynamicVectorRef< _elementType > Ref (const size_type size, const size_type startPosition=0) throw (std::out_of_range)
 
vctDynamicConstVectorRef
< _elementType > 
Ref (const size_type size, const size_type startPosition=0) const throw (std::out_of_range)
 
ThisTypeSumOf (const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
 
ThisTypeDifferenceOf (const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
 
ThisTypeElementwiseProductOf (const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
 
ThisTypeElementwiseRatioOf (const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
 
ThisTypeElementwiseMinOf (const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
 
ThisTypeElementwiseMaxOf (const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &vector1, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector2)
 
ThisTypeElementwiseClippedInOf (const vctDynamicConstVectorBase< __vectorOwnerType1, _elementType > &boundVector, const vctDynamicConstVectorBase< __vectorOwnerType2, _elementType > &vector)
 
ThisTypeAdd (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeSubtract (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeElementwiseMultiply (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeElementwiseDivide (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeElementwiseMin (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeElementwiseMax (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeElementwiseClipIn (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &boundVector)
 
ThisTypeoperator+= (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeoperator-= (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeSwapElementsWith (vctDynamicVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeSumOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type scalar)
 
ThisTypeDifferenceOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type scalar)
 
ThisTypeProductOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type scalar)
 
ThisTypeRatioOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type scalar)
 
ThisTypeClippedAboveOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type upperBound)
 
ThisTypeClippedBelowOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type lowerBound)
 
ThisTypeClippedInOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector, const value_type bound)
 
ThisTypeSumOf (const value_type scalar, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
 
ThisTypeDifferenceOf (const value_type scalar, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
 
ThisTypeProductOf (const value_type scalar, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
 
ThisTypeRatioOf (const value_type scalar, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
 
ThisTypeClippedAboveOf (const value_type upperBound, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
 
ThisTypeClippedBelowOf (const value_type lowerBound, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
 
ThisTypeClippedInOf (const value_type bound, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &vector)
 
ThisTypeAdd (const value_type scalar)
 
ThisTypeSubtract (const value_type scalar)
 
ThisTypeoperator+= (const value_type scalar)
 
ThisTypeoperator-= (const value_type scalar)
 
ThisTypeMultiply (const value_type scalar)
 
ThisTypeDivide (const value_type scalar)
 
ThisTypeClipAbove (const value_type upperBound)
 
ThisTypeClipBelow (const value_type lowerBound)
 
ThisTypeClipIn (const value_type bound)
 
ThisTypeoperator*= (const value_type scalar)
 
ThisTypeoperator/= (const value_type scalar)
 
ThisTypeProductOf (const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &inputMatrix, const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &inputVector)
 
ThisTypeProductOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &inputVector, const vctDynamicConstMatrixBase< __matrixOwnerType, _elementType > &inputMatrix)
 
ThisTypeAbsOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeNegationOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeFloorOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeCeilOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector)
 
ThisTypeNormalizedOf (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) throw (std::runtime_error)
 
ThisTypeAbsSelf (void)
 
ThisTypeNegationSelf (void)
 
ThisTypeFloorSelf (void)
 
ThisTypeCeilSelf (void)
 
ThisTypeNormalizedSelf (void) throw (std::runtime_error)
 
- Public Member Functions inherited from vctDynamicConstVectorBase< vctDynamicVectorRefOwner< _elementType >, _elementType >
 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
const_reverse_iterator rbegin (void) const
 
const_reverse_iterator rend (void) const
 
size_type size (void) const
 
difference_type stride () const
 
bool empty () const
 
const_reference operator[] (index_type index) const
 
const_reference at (size_type index) const throw (std::out_of_range)
 
const_reference operator() (size_type index) const throw (std::out_of_range)
 
const_reference Element (size_type index) const
 
const OwnerTypeOwner (void) const
 
const_pointer Pointer (index_type index=0) const
 
bool ValidIndex (size_type index) const
 
vctDynamicConstVectorRef
< _elementType > 
Ref (const size_type size, const size_type startPosition=0) const throw (std::out_of_range)
 
value_type DotProduct (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
std::string ToString (void) const
 
void ToStream (std::ostream &outputStream) const
 
void ToStreamRaw (std::ostream &outputStream, const char delimiter= ' ', bool headerOnly=false, const std::string &headerPrefix="") const
 
void SerializeRaw (std::ostream &outputStream) const
 
const value_type & X (void) const
 
const value_type & Y (void) const
 
const value_type & Z (void) const
 
const value_type & W (void) const
 
vctDynamicConstVectorRef
< _elementType > 
XY (void) const
 
vctDynamicConstVectorRef
< _elementType > 
XZ (void) const
 
vctDynamicConstVectorRef
< _elementType > 
XW (void) const
 
vctDynamicConstVectorRef
< _elementType > 
YZ (void) const
 
vctDynamicConstVectorRef
< _elementType > 
YW (void) const
 
vctDynamicConstVectorRef
< _elementType > 
ZW (void) const
 
vctDynamicConstVectorRef
< _elementType > 
XYZ (void) const
 
vctDynamicConstVectorRef
< _elementType > 
YZW (void) const
 
vctDynamicConstVectorRef
< _elementType > 
XYZW (void) const
 
value_type SumOfElements (void) const
 
value_type ProductOfElements (void) const
 
value_type NormSquare (void) const
 
NormType Norm (void) const
 
bool IsNormalized (void) const
 
bool IsNormalized (_elementType tolerance) const
 
value_type L1Norm (void) const
 
value_type LinfNorm (void) const
 
value_type MaxElement (void) const
 
value_type MinElement (void) const
 
value_type MaxAbsElement (void) const
 
value_type MinAbsElement (void) const
 
void MinAndMaxElement (value_type &minElement, value_type &maxElement) const
 
bool IsPositive (void) const
 
bool IsNonNegative (void) const
 
bool IsNonPositive (void) const
 
bool IsNegative (void) const
 
bool All (void) const
 
bool Any (void) const
 
bool IsFinite (void) const
 
bool HasNaN (void) const
 
bool IsCompact (void) const
 
bool IsFortran (void) const
 
bool FastCopyCompatible (const vctDynamicConstVectorBase< __vectorOwnerType, value_type > &source) const
 
bool FastCopyCompatible (const vctFixedSizeConstVectorBase< __size, __stride, value_type, __dataPtrType > &source) const
 
bool Equal (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
bool operator== (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
bool AlmostEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector, value_type tolerance) const
 
bool AlmostEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
bool NotEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
bool operator!= (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
bool Lesser (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
bool LesserOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
bool Greater (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
bool GreaterOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
BoolVectorReturnType ElementwiseEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
BoolVectorReturnType ElementwiseNotEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
BoolVectorReturnType ElementwiseLesser (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
BoolVectorReturnType ElementwiseLesserOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
BoolVectorReturnType ElementwiseGreater (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
BoolVectorReturnType ElementwiseGreaterOrEqual (const vctDynamicConstVectorBase< __vectorOwnerType, _elementType > &otherVector) const
 
bool Equal (const value_type &scalar) const
 
bool operator== (const value_type &scalar) const
 
bool NotEqual (const value_type &scalar) const
 
bool operator!= (const value_type &scalar) const
 
bool Lesser (const value_type &scalar) const
 
bool LesserOrEqual (const value_type &scalar) const
 
bool Greater (const value_type &scalar) const
 
bool GreaterOrEqual (const value_type &scalar) const
 
BoolVectorReturnType ElementwiseEqual (const value_type &scalar) const
 
BoolVectorReturnType ElementwiseNotEqual (const value_type &scalar) const
 
BoolVectorReturnType ElementwiseLesser (const value_type &scalar) const
 
BoolVectorReturnType ElementwiseLesserOrEqual (const value_type &scalar) const
 
BoolVectorReturnType ElementwiseGreater (const value_type &scalar) const
 
BoolVectorReturnType ElementwiseGreaterOrEqual (const value_type &scalar) const
 
VectorReturnType Abs (void) const
 
VectorReturnType Negation (void) const
 
VectorReturnType Floor (void) const
 
VectorReturnType Ceil (void) const
 
VectorReturnType Normalized (void) const throw (std::runtime_error)
 

Additional Inherited Members

- Protected Member Functions inherited from vctDynamicConstVectorBase< vctDynamicVectorRefOwner< _elementType >, _elementType >
void ThrowUnlessValidIndex (size_type index) const throw (std::out_of_range)
 
- Protected Attributes inherited from vctDynamicConstVectorBase< vctDynamicVectorRefOwner< _elementType >, _elementType >
OwnerType Vector
 

Detailed Description

template<class _elementType>
class vctDynamicVectorRef< _elementType >

Dynamic vector referencing existing memory.

The class vctDynamicVectorRef allows to create a vector overlaying an existing block of memory. It can be used to manipulate a container created by another toolkit (i.e. OpenGL, vtk, ...) or a cisstVector container using different parameters (different size, storage order or stride).

To setup the overlay, one can use either the constructors or the SetRef methods. When used with a cisst container, the SetRef methods can infer some of the memory layout information (pointer on first element, size, stride). When used to overlay existing memory referenced by a pointer, the user has to provide all the required information. In any case, the Ref object doesn't allocate nor free memory.

For example to manipulate the first five elements of a vector, one can do:

vctDynamicVector<double> wholeVector(10);
vctRandom(wholeVector, -10.0, 10.0);
first5.SetRef(wholeVector, 0, 5);
first5.SetAll(5.0);
Note
Make sure the underlying memory is not freed after the Ref object is created and before it is used. This would lead to faulty memory access and potential bugs.
vctDynamicVectorRef can perform const and non-const operations. It can be initialized with a non-const object only (value_type *). For a const Ref, see vctDynamicConstVectorRef.
See Also
vctDynamicVector, vctDynamicConstVectorRef
Parameters
_elementTypeType of elements referenced. Also defined as value_type.

Member Typedef Documentation

template<class _elementType>
typedef vctDynamicVectorBase<vctDynamicVectorRefOwner<_elementType>, _elementType> vctDynamicVectorRef< _elementType >::BaseType
template<class _elementType>
typedef VectorOwnerType::const_iterator vctDynamicVectorRef< _elementType >::const_iterator
template<class _elementType>
typedef VectorOwnerType::const_reverse_iterator vctDynamicVectorRef< _elementType >::const_reverse_iterator
template<class _elementType>
typedef BaseType::CopyType vctDynamicVectorRef< _elementType >::CopyType
template<class _elementType>
typedef VectorOwnerType::iterator vctDynamicVectorRef< _elementType >::iterator
template<class _elementType>
typedef VectorOwnerType::reverse_iterator vctDynamicVectorRef< _elementType >::reverse_iterator
template<class _elementType>
typedef vctDynamicVectorRef<_elementType> vctDynamicVectorRef< _elementType >::ThisType
template<class _elementType>
typedef vctDynamicVectorRefOwner<_elementType> vctDynamicVectorRef< _elementType >::VectorOwnerType

Constructor & Destructor Documentation

template<class _elementType>
vctDynamicVectorRef< _elementType >::vctDynamicVectorRef ( )
inline

Default constructor initializes the vector reference to NULL

template<class _elementType>
vctDynamicVectorRef< _elementType >::vctDynamicVectorRef ( const ThisType other)
inline

Copy constructor. This copy constructor takes a const reference on the object to copy but has to remove the const-ness of the point to create a vctDynamicVectorRef and allow it to manipulate elements. The explict use of a const_cast is far from great but there is no easy solution as C++ requires the copy constructor to take a const reference.

template<class _elementType>
vctDynamicVectorRef< _elementType >::vctDynamicVectorRef ( size_type  size,
value_type *  data,
stride_type  stride = 1 
)
inline
template<class _elementType>
template<size_type __size, stride_type __stride, class __dataPtrType >
vctDynamicVectorRef< _elementType >::vctDynamicVectorRef ( vctFixedSizeVectorBase< __size, __stride, _elementType, __dataPtrType > &  otherVector,
size_type  startPosition = 0 
)
inline

Initialize a dynamic reference to a fixed-size vector.

Note
This constructor is non-explicit, and allows automatic conversion from a fixed-size vector to a dynamic vector representation.
The size and stride values are taken from the fixed size vector.
template<class _elementType>
template<size_type __size, stride_type __stride, class __dataPtrType >
vctDynamicVectorRef< _elementType >::vctDynamicVectorRef ( vctFixedSizeVectorBase< __size, __stride, _elementType, __dataPtrType > &  otherVector,
size_type  startPosition,
size_type  length 
)
inline

Initialize a dynamic reference to specified subvector of a fixed-size vector.

Note
This constructor allows automatic conversion from a fixed-size vector to a dynamic vector representation.
The stride values are taken from the fixed size vector, but the starting point and length must be specified.
template<class _elementType>
template<class __vectorOwnerType >
vctDynamicVectorRef< _elementType >::vctDynamicVectorRef ( vctDynamicVectorBase< __vectorOwnerType, _elementType > &  otherVector)
inline

Initialize a dynamic reference to a dynamic vector.

Note
the starting point, size, and stride, are taken from the other vector.
template<class _elementType>
template<class __vectorOwnerType >
vctDynamicVectorRef< _elementType >::vctDynamicVectorRef ( vctDynamicVectorBase< __vectorOwnerType, _elementType > &  otherVector,
size_type  startPosition,
size_type  length 
)
inline

Initialize a dynamic reference to a dynamic vector.

Note
the stride is taken from the other vector, but the starting point and the length must be specified.

Member Function Documentation

template<class _elementType>
void vctDynamicVectorRef< _elementType >::DeSerializeRaw ( std::istream &  inputStream)
throw (std::runtime_error
)
inline

Binary deserialization. This method can not resize the existing block of memory and will throw an exception is the sizes don't match.

template<class _elementType>
ThisType& vctDynamicVectorRef< _elementType >::operator= ( const ThisType other)
inline

Assignment operation between vectors of different types

Parameters
otherThe vector to be copied.
Note
We overload operator = to perform elemenwise copy/assign. Although one may consider other meanings for the overloaded operator, we thought this was the most natural one.
template<class _elementType>
ThisType& vctDynamicVectorRef< _elementType >::operator= ( const vctDynamicConstVectorRef< value_type > &  other)
inline
template<class _elementType>
template<class __vectorOwnerType , typename __elementType >
ThisType& vctDynamicVectorRef< _elementType >::operator= ( const vctDynamicConstVectorBase< __vectorOwnerType, __elementType > &  other)
inline
template<class _elementType>
template<size_type __size, stride_type __stride, class __elementType , class __dataPtrType >
ThisType& vctDynamicVectorRef< _elementType >::operator= ( const vctFixedSizeConstVectorBase< __size, __stride, __elementType, __dataPtrType > &  other)
inline
template<class _elementType>
ThisType& vctDynamicVectorRef< _elementType >::operator= ( const value_type &  value)
inline

Assignement of a scalar to all elements. See also SetAll.

template<class _elementType>
void vctDynamicVectorRef< _elementType >::SetRef ( size_type  size,
pointer  data,
stride_type  stride = 1 
)
inline
template<class _elementType>
template<size_type __size, stride_type __stride, class __dataPtrType >
void vctDynamicVectorRef< _elementType >::SetRef ( vctFixedSizeVectorBase< __size, __stride, _elementType, __dataPtrType > &  otherVector,
size_type  startPosition = 0 
)
inline

Set a dynamic reference to a fixed-size vector.

Parameters
otherVectorthe vector for which a new reference is set.
startPositionthe index of the first element in otherVector to be indexed by this reference.
Note
The size of the reference is set to the size of otherVector minus the startPosition. By default, startPosition=0 and the behavior is transparent.
the size and memory stride of this reference will be equal to the size and memory stride of the input vector.
template<class _elementType>
template<size_type __size, stride_type __stride, class __dataPtrType >
void vctDynamicVectorRef< _elementType >::SetRef ( vctFixedSizeVectorBase< __size, __stride, _elementType, __dataPtrType > &  otherVector,
size_type  startPosition,
size_type  length 
)
throw (std::out_of_range
)
inline

Set a dynamic reference to a specified subvector of a fixed-size vector.

Note
the memory stride of this reference will be equal to the memory stride of the input vector.
This method verifies that the size of this vector does not exceed the size of the input vector (otherwise cmnThrow is used to throw std::out_of_range).
template<class _elementType>
template<class __vectorOwnerType >
void vctDynamicVectorRef< _elementType >::SetRef ( vctDynamicVectorBase< __vectorOwnerType, _elementType > &  otherVector)
inline

Set a dynamic reference to a dynamic vector.

Note
the size and memory stride of this reference will be equal to the size memory stride of the input vector.
template<class _elementType>
template<class __vectorOwnerType >
void vctDynamicVectorRef< _elementType >::SetRef ( vctDynamicVectorBase< __vectorOwnerType, _elementType > &  otherVector,
size_type  startPosition,
size_type  length 
)
throw (std::out_of_range
)
inline

Set a dynamic reference to a specified subvector of a dynamic vector.

Note
the memory stride of this reference will be equal to the memory stride of the input vector.
This method verifies that the size of this vector does not exceed the size of the input vector (otherwise cmnThrow is used to throw std::out_of_range).
template<class _elementType>
vctDynamicVectorRef< _elementType >::VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType  )

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