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

#include <vctDynamicNArrayOwner.h>

Public Types

enum  { DIMENSION = _dimension }
 
typedef vctDynamicNArrayOwner
< _elementType, _dimension > 
ThisType
 
typedef
vctVarStrideNArrayIterator
< ThisType, true > 
iterator
 
typedef
vctVarStrideNArrayConstIterator
< ThisType, true > 
const_iterator
 
typedef
vctVarStrideNArrayIterator
< ThisType, false > 
reverse_iterator
 
typedef
vctVarStrideNArrayConstIterator
< ThisType, false > 
const_reverse_iterator
 

Public Member Functions

 VCT_CONTAINER_TRAITS_TYPEDEFS (_elementType)
 
 VCT_NARRAY_TRAITS_TYPEDEFS (_dimension)
 
 vctDynamicNArrayOwner ()
 
 vctDynamicNArrayOwner (const nsize_type &sizes)
 
 ~vctDynamicNArrayOwner ()
 
dimension_type dimension (void) const
 
const nsize_type & sizes (void) const
 
size_type size (dimension_type dimension) const
 
size_type size (void) const
 
const nstride_type & strides (void) const
 
stride_type stride (dimension_type dimension) const
 
pointer Pointer (void)
 
pointer Pointer (const nsize_type &indices)
 
const_pointer Pointer (void) const
 
const_pointer Pointer (const nsize_type &indices) const
 
iterator begin (void)
 
iterator end (void)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
reverse_iterator rbegin (void)
 
reverse_iterator rend (void)
 
const_reverse_iterator rbegin (void) const
 
const_reverse_iterator rend (void) const
 
bool IsCompact (void) const
 
void SetSize (const nsize_type &sizes)
 
value_type * Release (void)
 
value_type * Own (const nsize_type &sizes, value_type *data)
 
void clear (void)
 
void Disown (void)
 

Protected Member Functions

void UpdateStrides (void)
 

Protected Attributes

nsize_type SizesMember
 
nstride_type StridesMember
 
value_type * Data
 

Detailed Description

template<class _elementType, vct::size_type _dimension>
class vctDynamicNArrayOwner< _elementType, _dimension >

This templated class owns a dynamically allocated array, but does not provide any other operations

Member Typedef Documentation

template<class _elementType , vct::size_type _dimension>
typedef vctVarStrideNArrayConstIterator<ThisType, true> vctDynamicNArrayOwner< _elementType, _dimension >::const_iterator
template<class _elementType , vct::size_type _dimension>
typedef vctVarStrideNArrayConstIterator<ThisType, false> vctDynamicNArrayOwner< _elementType, _dimension >::const_reverse_iterator
template<class _elementType , vct::size_type _dimension>
typedef vctVarStrideNArrayIterator<ThisType, true> vctDynamicNArrayOwner< _elementType, _dimension >::iterator
template<class _elementType , vct::size_type _dimension>
typedef vctVarStrideNArrayIterator<ThisType, false> vctDynamicNArrayOwner< _elementType, _dimension >::reverse_iterator
template<class _elementType , vct::size_type _dimension>
typedef vctDynamicNArrayOwner<_elementType, _dimension> vctDynamicNArrayOwner< _elementType, _dimension >::ThisType

The type of this owner.

Member Enumeration Documentation

template<class _elementType , vct::size_type _dimension>
anonymous enum
Enumerator
DIMENSION 

Constructor & Destructor Documentation

template<class _elementType , vct::size_type _dimension>
vctDynamicNArrayOwner< _elementType, _dimension >::vctDynamicNArrayOwner ( )
inline
template<class _elementType , vct::size_type _dimension>
vctDynamicNArrayOwner< _elementType, _dimension >::vctDynamicNArrayOwner ( const nsize_type &  sizes)
inline
template<class _elementType , vct::size_type _dimension>
vctDynamicNArrayOwner< _elementType, _dimension >::~vctDynamicNArrayOwner ( )
inline

Member Function Documentation

template<class _elementType , vct::size_type _dimension>
iterator vctDynamicNArrayOwner< _elementType, _dimension >::begin ( void  )
inline
template<class _elementType , vct::size_type _dimension>
const_iterator vctDynamicNArrayOwner< _elementType, _dimension >::begin ( void  ) const
inline
template<class _elementType , vct::size_type _dimension>
void vctDynamicNArrayOwner< _elementType, _dimension >::clear ( void  )
inline

Free the memory allocated for the data pointer. Set sizes in all dimensions to zero, but keep dimensionality.

template<class _elementType , vct::size_type _dimension>
dimension_type vctDynamicNArrayOwner< _elementType, _dimension >::dimension ( void  ) const
inline

Return the number of dimensions of the nArray.

Returns
the number of dimensions of this nArray
template<class _elementType , vct::size_type _dimension>
void vctDynamicNArrayOwner< _elementType, _dimension >::Disown ( void  )
inline

Free the memory allocated for the data pointer. Reset data pointer and size to zero.

template<class _elementType , vct::size_type _dimension>
iterator vctDynamicNArrayOwner< _elementType, _dimension >::end ( void  )
inline
template<class _elementType , vct::size_type _dimension>
const_iterator vctDynamicNArrayOwner< _elementType, _dimension >::end ( void  ) const
inline
template<class _elementType , vct::size_type _dimension>
bool vctDynamicNArrayOwner< _elementType, _dimension >::IsCompact ( void  ) const
inline
template<class _elementType , vct::size_type _dimension>
value_type* vctDynamicNArrayOwner< _elementType, _dimension >::Own ( const nsize_type &  sizes,
value_type *  data 
)
inline

Have this owner take ownership of a new data pointer. Return the old data pointer without freeing memory.

Returns
data pointer the nArray held before taking ownership of the new data pointer
Note
This method returns a pointer to the previously owned memory block but doesn't tell the size of the block.
template<class _elementType , vct::size_type _dimension>
pointer vctDynamicNArrayOwner< _elementType, _dimension >::Pointer ( void  )
inline

Return a pointer to the nArray's data.

Returns
a pointer to this nArray's data
template<class _elementType , vct::size_type _dimension>
pointer vctDynamicNArrayOwner< _elementType, _dimension >::Pointer ( const nsize_type &  indices)
inline

Return a pointer to the nArray's data at the specified element.

Returns
a pointer to this nArray's data at the specified element
template<class _elementType , vct::size_type _dimension>
const_pointer vctDynamicNArrayOwner< _elementType, _dimension >::Pointer ( void  ) const
inline

Return a const pointer to the nArray's data.

Returns
a const pointer to this nArray's data
template<class _elementType , vct::size_type _dimension>
const_pointer vctDynamicNArrayOwner< _elementType, _dimension >::Pointer ( const nsize_type &  indices) const
inline

Return a const pointer to the nArray's data at the specified element.

Returns
a const pointer to this nArray's data at the specified element
template<class _elementType , vct::size_type _dimension>
reverse_iterator vctDynamicNArrayOwner< _elementType, _dimension >::rbegin ( void  )
inline
template<class _elementType , vct::size_type _dimension>
const_reverse_iterator vctDynamicNArrayOwner< _elementType, _dimension >::rbegin ( void  ) const
inline
template<class _elementType , vct::size_type _dimension>
value_type* vctDynamicNArrayOwner< _elementType, _dimension >::Release ( void  )
inline

Release the currently owned data pointer from being owned. Reset this owner's data pointer and size to zero. Return the old data pointer without freeing memory.

template<class _elementType , vct::size_type _dimension>
reverse_iterator vctDynamicNArrayOwner< _elementType, _dimension >::rend ( void  )
inline
template<class _elementType , vct::size_type _dimension>
const_reverse_iterator vctDynamicNArrayOwner< _elementType, _dimension >::rend ( void  ) const
inline
template<class _elementType , vct::size_type _dimension>
void vctDynamicNArrayOwner< _elementType, _dimension >::SetSize ( const nsize_type &  sizes)
inline

Non-preserving resize operation. This method discards of all the current data of the nArray and allocates new space in the requested size. Dimensionality remains unchanged.

Parameters
sizesVector of sizes in each dimension. If this vector does not have the same number of elements as the nArray's dimension, this method does nothing.
Note
If the number of dimensions and the sizes of all dimensions are unchanged, this method does nothing.
template<class _elementType , vct::size_type _dimension>
size_type vctDynamicNArrayOwner< _elementType, _dimension >::size ( dimension_type  dimension) const
inline

Return the size of a dimension.

Parameters
dimensionthe dimension of interest
Returns
the size of the nArray in the given dimension
Note
the dimension is zero-based
template<class _elementType , vct::size_type _dimension>
size_type vctDynamicNArrayOwner< _elementType, _dimension >::size ( void  ) const
inline

Return the size of the nArray.

Returns
the number of elements
Note
This method returns 0 if the dimension of the nArray is zero.
template<class _elementType , vct::size_type _dimension>
const nsize_type& vctDynamicNArrayOwner< _elementType, _dimension >::sizes ( void  ) const
inline

Return the size of each dimension.

Returns
a vector containing the size of the nArray in each dimension
template<class _elementType , vct::size_type _dimension>
stride_type vctDynamicNArrayOwner< _elementType, _dimension >::stride ( dimension_type  dimension) const
inline

Return the stride of a dimension.

Parameters
dimensionthe dimension of interest
Returns
the stride of the nArray in the given dimension
template<class _elementType , vct::size_type _dimension>
const nstride_type& vctDynamicNArrayOwner< _elementType, _dimension >::strides ( void  ) const
inline

Return the strides of each dimension.

Returns
a vector containing the strides of the nArray in each dimension
template<class _elementType , vct::size_type _dimension>
void vctDynamicNArrayOwner< _elementType, _dimension >::UpdateStrides ( void  )
inlineprotected

Update the StridesMember vector to reflect the elements of the SizesMember vector.

template<class _elementType , vct::size_type _dimension>
vctDynamicNArrayOwner< _elementType, _dimension >::VCT_CONTAINER_TRAITS_TYPEDEFS ( _elementType  )
template<class _elementType , vct::size_type _dimension>
vctDynamicNArrayOwner< _elementType, _dimension >::VCT_NARRAY_TRAITS_TYPEDEFS ( _dimension  )

Member Data Documentation

template<class _elementType , vct::size_type _dimension>
value_type* vctDynamicNArrayOwner< _elementType, _dimension >::Data
protected
template<class _elementType , vct::size_type _dimension>
nsize_type vctDynamicNArrayOwner< _elementType, _dimension >::SizesMember
protected
template<class _elementType , vct::size_type _dimension>
nstride_type vctDynamicNArrayOwner< _elementType, _dimension >::StridesMember
protected

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