Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itk::FixedArray< TValueType, VLength > Class Template Reference
[Data Representation Objects]

#include <itkFixedArray.h>

Inheritance diagram for itk::FixedArray< TValueType, VLength >:

Inheritance graph
[legend]
List of all members.

Detailed Description

template<typename TValueType, unsigned int VLength = 3>
class itk::FixedArray< TValueType, VLength >

Simulate a standard C array with copy semnatics.

Simulates a standard C array, except that copy semantics are used instead of reference semantics. Also, arrays of different sizes cannot be assigned to one another, and size information is known for function returns.

Template parameters for class FixedArray:

The length of the array is fixed at compile time. If you wish to specify the length of the array at run-time, use the class itk::Array. If you wish to change to change the length of the array at run-time, you're best off using std::vector<>.

Examples:

Testing/Code/Common/itkVectorImageTest.cxx.

Definition at line 64 of file itkFixedArray.h.

Public Types

typedef ValueType CArray [VLength]
typedef const ValueTypeconst_pointer
typedef const ValueTypeconst_reference
typedef const ValueTypeConstIterator
typedef ValueTypeIterator
typedef ValueTypepointer
typedef ValueTypereference
typedef unsigned int SizeType
typedef TValueType ValueType

Public Member Functions

 itkStaticConstMacro (Dimension, unsigned int, VLength)
 itkStaticConstMacro (Length, unsigned int, VLength)
FixedArrayoperator= (const ValueType r[VLength])
 ~FixedArray ()
ConstIterator Begin () const
Iterator Begin ()
ConstIterator End () const
Iterator End ()
void Fill (const ValueType &)
ConstReverseIterator rBegin () const
ReverseIterator rBegin ()
ConstReverseIterator rEnd () const
ReverseIterator rEnd ()
SizeType Size () const
const ValueTypeGetDataPointer () const
ValueTypeGetDataPointer ()
const_reference GetElement (unsigned short index) const
void SetElement (unsigned short index, const_reference value)
bool operator!= (const FixedArray &r) const
bool operator== (const FixedArray &r) const
template<class TFixedArrayValueType>
FixedArrayoperator= (const FixedArray< TFixedArrayValueType, VLength > &r)
const_reference operator[] (unsigned long index) const
reference operator[] (unsigned long index)
const_reference operator[] (long index) const
reference operator[] (long index)
const_reference operator[] (unsigned int index) const
reference operator[] (unsigned int index)
const_reference operator[] (int index) const
reference operator[] (int index)
const_reference operator[] (unsigned short index) const
reference operator[] (unsigned short index)
const_reference operator[] (short index) const
reference operator[] (short index)

Static Public Member Functions

static FixedArray Filled (const ValueType &)

Classes

class  ConstReverseIterator
 A const reverse iterator through the array. More...
class  ReverseIterator
 A reverse iterator through the array. More...


Member Typedef Documentation

template<typename TValueType, unsigned int VLength = 3>
typedef ValueType itk::FixedArray< TValueType, VLength >::CArray[VLength]

A type representing the C-array version of this FixedArray.

Definition at line 77 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef const ValueType* itk::FixedArray< TValueType, VLength >::const_pointer

A const pointer to the ValueType.

Definition at line 123 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef const ValueType& itk::FixedArray< TValueType, VLength >::const_reference

A const reference to the ValueType.

Definition at line 129 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef const ValueType* itk::FixedArray< TValueType, VLength >::ConstIterator

A const iterator through the array.

Reimplemented in itk::ContinuousIndex< TCoordRep, VIndexDimension >, itk::Point< TCoordRep, NPointDimension >, itk::QuadEdgeMeshPoint< TCoordRep, VPointDimension, TQuadEdge >, itk::Point< TCoordRep, VIndexDimension >, and itk::Point< TCoordRep, VPointDimension >.

Definition at line 83 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef ValueType* itk::FixedArray< TValueType, VLength >::Iterator

An iterator through the array.

Reimplemented in itk::ContinuousIndex< TCoordRep, VIndexDimension >, itk::Point< TCoordRep, NPointDimension >, itk::QuadEdgeMeshPoint< TCoordRep, VPointDimension, TQuadEdge >, itk::Point< TCoordRep, VIndexDimension >, and itk::Point< TCoordRep, VPointDimension >.

Definition at line 80 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef ValueType* itk::FixedArray< TValueType, VLength >::pointer

A pointer to the ValueType.

Definition at line 120 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef ValueType& itk::FixedArray< TValueType, VLength >::reference

A reference to the ValueType.

Definition at line 126 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef unsigned int itk::FixedArray< TValueType, VLength >::SizeType

Definition at line 131 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
typedef TValueType itk::FixedArray< TValueType, VLength >::ValueType

The element type stored at each location in the FixedArray.

Reimplemented in itk::ContinuousIndex< TCoordRep, VIndexDimension >, itk::CovariantVector< T, NVectorDimension >, itk::DiffusionTensor3D< TComponent >, itk::Point< TCoordRep, NPointDimension >, itk::RGBPixel< TComponent >, itk::SymmetricSecondRankTensor< TComponent, NDimension >, itk::Vector< T, NVectorDimension >, itk::QuadEdgeMeshPoint< TCoordRep, VPointDimension, TQuadEdge >, itk::Point< TCoordRep, VIndexDimension >, itk::Point< TCoordRep, VPointDimension >, itk::RGBPixel< unsigned short >, itk::RGBPixel< unsigned char >, itk::RGBPixel< TPixel >, itk::SymmetricSecondRankTensor< TComponent, 3 >, and itk::Vector< double, VDimension >.

Definition at line 74 of file itkFixedArray.h.


Constructor & Destructor Documentation

template<typename TValueType, unsigned int VLength = 3>
itk::FixedArray< TValueType, VLength >::FixedArray (  ) 

Constructors

template<typename TValueType, unsigned int VLength = 3>
itk::FixedArray< TValueType, VLength >::FixedArray ( const ValueType  r[VLength]  ) 

template<typename TValueType, unsigned int VLength = 3>
template<class TFixedArrayValueType>
itk::FixedArray< TValueType, VLength >::FixedArray ( const FixedArray< TFixedArrayValueType, VLength > &  r  )  [inline]

Constructor to initialize a fixed array from another of any data type

Definition at line 141 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
itk::FixedArray< TValueType, VLength >::~FixedArray (  ) 

This destructor is not virtual for performance reasons. However, this means that subclasses cannot allocate memory.

template<typename TValueType, unsigned int VLength = 3>
template<class TFixedArrayValueType>
itk::FixedArray< TValueType, VLength >::FixedArray ( const FixedArray< TFixedArrayValueType, VLength > &  r  )  [inline]

Constructor to initialize a fixed array from another of any data type

Definition at line 141 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
itk::FixedArray< TValueType, VLength >::FixedArray ( const ValueType  r[VLength]  ) 

template<typename TValueType, unsigned int VLength = 3>
itk::FixedArray< TValueType, VLength >::FixedArray (  ) 

Constructors


Member Function Documentation

template<typename TValueType, unsigned int VLength = 3>
ConstIterator itk::FixedArray< TValueType, VLength >::Begin (  )  const

template<typename TValueType, unsigned int VLength = 3>
Iterator itk::FixedArray< TValueType, VLength >::Begin (  ) 

Get various iterators to the array.

Referenced by itk::FixedArray< unsigned char, 3 >::FixedArray(), and itk::FixedArray< unsigned char, 3 >::operator=().

template<typename TValueType, unsigned int VLength = 3>
ConstIterator itk::FixedArray< TValueType, VLength >::End (  )  const

template<typename TValueType, unsigned int VLength = 3>
Iterator itk::FixedArray< TValueType, VLength >::End (  ) 

Referenced by itk::FixedArray< unsigned char, 3 >::FixedArray(), and itk::FixedArray< unsigned char, 3 >::operator=().

template<typename TValueType, unsigned int VLength = 3>
void itk::FixedArray< TValueType, VLength >::Fill ( const ValueType  ) 

Referenced by itk::MeasurementVectorTraits::SetLength().

template<typename TValueType, unsigned int VLength = 3>
static FixedArray itk::FixedArray< TValueType, VLength >::Filled ( const ValueType  )  [static]

template<typename TValueType, unsigned int VLength = 3>
const ValueType* itk::FixedArray< TValueType, VLength >::GetDataPointer (  )  const [inline]

Definition at line 201 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
ValueType* itk::FixedArray< TValueType, VLength >::GetDataPointer (  )  [inline]

Return a pointer to the data.

Definition at line 200 of file itkFixedArray.h.

Referenced by itk::Accessor::VectorToRGBPixelAccessor< T >::Get(), itk::Accessor::RGBToVectorPixelAccessor< T >::Get(), and itk::MetaArrayWriter::SetInput().

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::GetElement ( unsigned short  index  )  const [inline]

Definition at line 196 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
itk::FixedArray< TValueType, VLength >::itkStaticConstMacro ( Dimension  ,
unsigned  int,
VLength   
)

Dimension constant

template<typename TValueType, unsigned int VLength = 3>
itk::FixedArray< TValueType, VLength >::itkStaticConstMacro ( Length  ,
unsigned  int,
VLength   
)

Length constant

template<typename TValueType, unsigned int VLength = 3>
bool itk::FixedArray< TValueType, VLength >::operator!= ( const FixedArray< TValueType, VLength > &  r  )  const [inline]

Definition at line 172 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
FixedArray& itk::FixedArray< TValueType, VLength >::operator= ( const ValueType  r[VLength]  ) 

template<typename TValueType, unsigned int VLength = 3>
template<class TFixedArrayValueType>
FixedArray& itk::FixedArray< TValueType, VLength >::operator= ( const FixedArray< TFixedArrayValueType, VLength > &  r  )  [inline]

Operator= defined for a variety of types.

Definition at line 156 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
bool itk::FixedArray< TValueType, VLength >::operator== ( const FixedArray< TValueType, VLength > &  r  )  const

Operators == and != are used to compare whether two arrays are equal. Note that arrays are equal when the number of components (size) is the same, and each component value is equal.

Referenced by itk::FixedArray< unsigned char, 3 >::operator!=().

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned long  index  )  const [inline]

Definition at line 190 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned long  index  )  [inline]

Definition at line 189 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( long  index  )  const [inline]

Definition at line 188 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( long  index  )  [inline]

Definition at line 187 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned int  index  )  const [inline]

Definition at line 186 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned int  index  )  [inline]

Definition at line 185 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( int  index  )  const [inline]

Definition at line 184 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( int  index  )  [inline]

Definition at line 183 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned short  index  )  const [inline]

Definition at line 182 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( unsigned short  index  )  [inline]

Definition at line 181 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
const_reference itk::FixedArray< TValueType, VLength >::operator[] ( short  index  )  const [inline]

Definition at line 180 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
reference itk::FixedArray< TValueType, VLength >::operator[] ( short  index  )  [inline]

Allow the FixedArray to be indexed normally. No bounds checking is done. The separate versions are a work-around for an integer conversion bug in Visual C++.

Definition at line 179 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
ConstReverseIterator itk::FixedArray< TValueType, VLength >::rBegin (  )  const

template<typename TValueType, unsigned int VLength = 3>
ReverseIterator itk::FixedArray< TValueType, VLength >::rBegin (  ) 

template<typename TValueType, unsigned int VLength = 3>
ConstReverseIterator itk::FixedArray< TValueType, VLength >::rEnd (  )  const

template<typename TValueType, unsigned int VLength = 3>
ReverseIterator itk::FixedArray< TValueType, VLength >::rEnd (  ) 

template<typename TValueType, unsigned int VLength = 3>
void itk::FixedArray< TValueType, VLength >::SetElement ( unsigned short  index,
const_reference  value 
) [inline]

Set/Get element methods are more convenient in wrapping languages

Definition at line 194 of file itkFixedArray.h.

template<typename TValueType, unsigned int VLength = 3>
SizeType itk::FixedArray< TValueType, VLength >::Size (  )  const


The documentation for this class was generated from the following file:
Generated at Sun Sep 23 16:59:58 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000