ITK  5.0.0
Insight Segmentation and Registration Toolkit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Attributes | List of all members
itk::FixedArray< TValue, VLength > Class Template Reference

#include <itkFixedArray.h>

+ Inheritance diagram for itk::FixedArray< TValue, VLength >:
+ Collaboration diagram for itk::FixedArray< TValue, VLength >:

Detailed Description

template<typename TValue, unsigned int VLength = 3>
class itk::FixedArray< TValue, 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
TValueElement type stored at each location in the array.
VLength= Length of the array.

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<>.

Wiki Examples:
Examples:
Examples/Statistics/ImageToListSampleAdaptor.cxx, Examples/Statistics/PointSetToAdaptor.cxx, Examples/Statistics/ScalarImageMarkovRandomField1.cxx, SphinxExamples/src/Core/Common/CreateAFixedArray/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/Create3DVolume/Code.cxx, WikiExamples/ImageProcessing/PermuteAxesImageFilter.cxx, WikiExamples/ImageProcessing/ScaleTransform.cxx, WikiExamples/ImageProcessing/TileImageFilter_CreateVolume.cxx, WikiExamples/ImageProcessing/TileImageFilter_SideBySide.cxx, WikiExamples/Images/FlipImageFilter.cxx, and WikiExamples/Statistics/ImageToListSampleAdaptor.cxx.

Definition at line 51 of file itkFixedArray.h.

Classes

class  ConstReverseIterator
 
class  ReverseIterator
 

Public Types

typedef ValueType CArray [VLength]
 
using const_pointer = const ValueType *
 
using const_reference = const ValueType &
 
using ConstIterator = const ValueType *
 
using Iterator = ValueType *
 
using pointer = ValueType *
 
using reference = ValueType &
 
using SizeType = unsigned int
 
using ValueType = TValue
 

Public Member Functions

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

Static Public Member Functions

static FixedArray Filled (const ValueType &)
 

Static Public Attributes

static constexpr unsigned int Dimension = VLength
 
static constexpr unsigned int Length = VLength
 

Private Attributes

CArray m_InternalArray
 

Member Typedef Documentation

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

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

Definition at line 64 of file itkFixedArray.h.

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

A const pointer to the ValueType.

Definition at line 122 of file itkFixedArray.h.

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

A const reference to the ValueType.

Definition at line 128 of file itkFixedArray.h.

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

A const iterator through the array.

Definition at line 70 of file itkFixedArray.h.

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

An iterator through the array.

Definition at line 67 of file itkFixedArray.h.

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

A pointer to the ValueType.

Definition at line 119 of file itkFixedArray.h.

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

A reference to the ValueType.

Definition at line 125 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
using itk::FixedArray< TValue, VLength >::SizeType = unsigned int

Definition at line 130 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
using itk::FixedArray< TValue, VLength >::ValueType = TValue

The element type stored at each location in the FixedArray.

Definition at line 61 of file itkFixedArray.h.

Constructor & Destructor Documentation

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

Constructors

template<typename TValue, unsigned int VLength = 3>
itk::FixedArray< TValue, VLength >::FixedArray ( const FixedArray< TValue, VLength > &  )
default

Constructors

template<typename TValue, unsigned int VLength = 3>
itk::FixedArray< TValue, VLength >::FixedArray ( FixedArray< TValue, VLength > &&  )
default

Constructors

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

Constructors

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

Conversion constructors

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

Conversion constructors

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

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

Definition at line 149 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
template<typename TScalarValue >
itk::FixedArray< TValue, VLength >::FixedArray ( const TScalarValue *  r)
inline

Definition at line 161 of file itkFixedArray.h.

Member Function Documentation

template<typename TValue, unsigned int VLength = 3>
Iterator itk::FixedArray< TValue, VLength >::Begin ( )
template<typename TValue, unsigned int VLength = 3>
ConstIterator itk::FixedArray< TValue, VLength >::Begin ( ) const
template<typename TValue, unsigned int VLength = 3>
Iterator itk::FixedArray< TValue, VLength >::End ( )
template<typename TValue, unsigned int VLength = 3>
ConstIterator itk::FixedArray< TValue, VLength >::End ( ) const
template<typename TValue, unsigned int VLength = 3>
void itk::FixedArray< TValue, VLength >::Fill ( const ValueType )
template<typename TValue, unsigned int VLength = 3>
static FixedArray itk::FixedArray< TValue, VLength >::Filled ( const ValueType )
static
template<typename TValue, unsigned int VLength = 3>
ValueType* itk::FixedArray< TValue, VLength >::GetDataPointer ( )
inline
template<typename TValue, unsigned int VLength = 3>
const ValueType* itk::FixedArray< TValue, VLength >::GetDataPointer ( ) const
inline

Definition at line 238 of file itkFixedArray.h.

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

Set/Get element methods are more convenient in wrapping languages

Definition at line 229 of file itkFixedArray.h.

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

Definition at line 190 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
FixedArray& itk::FixedArray< TValue, VLength >::operator= ( const FixedArray< TValue, VLength > &  )
default

Constructors

template<typename TValue, unsigned int VLength = 3>
FixedArray& itk::FixedArray< TValue, VLength >::operator= ( FixedArray< TValue, VLength > &&  )
default

Constructors

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

Operator= defined for a variety of types.

Definition at line 168 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
FixedArray& itk::FixedArray< TValue, VLength >::operator= ( const ValueType  r[VLength])
template<typename TValue, unsigned int VLength = 3>
bool itk::FixedArray< TValue, VLength >::operator== ( const FixedArray< TValue, 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.

template<typename TValue, unsigned int VLength = 3>
reference itk::FixedArray< TValue, 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 196 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
const_reference itk::FixedArray< TValue, VLength >::operator[] ( short  index) const
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 197 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
reference itk::FixedArray< TValue, VLength >::operator[] ( unsigned 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 198 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
const_reference itk::FixedArray< TValue, VLength >::operator[] ( unsigned short  index) const
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 199 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
reference itk::FixedArray< TValue, VLength >::operator[] ( int  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 200 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
const_reference itk::FixedArray< TValue, VLength >::operator[] ( int  index) const
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 201 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
reference itk::FixedArray< TValue, VLength >::operator[] ( unsigned int  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 209 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
const_reference itk::FixedArray< TValue, VLength >::operator[] ( unsigned int  index) const
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 210 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
reference itk::FixedArray< TValue, VLength >::operator[] ( long  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 216 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
const_reference itk::FixedArray< TValue, VLength >::operator[] ( long  index) const
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 217 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
reference itk::FixedArray< TValue, VLength >::operator[] ( unsigned long  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 218 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
const_reference itk::FixedArray< TValue, VLength >::operator[] ( unsigned long  index) const
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 219 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
reference itk::FixedArray< TValue, VLength >::operator[] ( long long  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 220 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
const_reference itk::FixedArray< TValue, VLength >::operator[] ( long long  index) const
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 221 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
reference itk::FixedArray< TValue, VLength >::operator[] ( unsigned long long  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 222 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
const_reference itk::FixedArray< TValue, VLength >::operator[] ( unsigned long long  index) const
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 223 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
ReverseIterator itk::FixedArray< TValue, VLength >::rBegin ( )
template<typename TValue, unsigned int VLength = 3>
ConstReverseIterator itk::FixedArray< TValue, VLength >::rBegin ( ) const
template<typename TValue, unsigned int VLength = 3>
ReverseIterator itk::FixedArray< TValue, VLength >::rEnd ( )
template<typename TValue, unsigned int VLength = 3>
ConstReverseIterator itk::FixedArray< TValue, VLength >::rEnd ( ) const
template<typename TValue, unsigned int VLength = 3>
void itk::FixedArray< TValue, VLength >::SetElement ( unsigned short  index,
const_reference  value 
)
inline

Set/Get element methods are more convenient in wrapping languages

Definition at line 227 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
SizeType itk::FixedArray< TValue, VLength >::Size ( ) const
template<typename TValue, unsigned int VLength = 3>
void itk::FixedArray< TValue, VLength >::swap ( FixedArray< TValue, VLength > &  other)
inline

Definition at line 264 of file itkFixedArray.h.

Referenced by itk::swap().

Member Data Documentation

template<typename TValue, unsigned int VLength = 3>
constexpr unsigned int itk::FixedArray< TValue, VLength >::Dimension = VLength
static

Dimension constant

Definition at line 58 of file itkFixedArray.h.

template<typename TValue, unsigned int VLength = 3>
constexpr unsigned int itk::FixedArray< TValue, VLength >::Length = VLength
static
template<typename TValue, unsigned int VLength = 3>
CArray itk::FixedArray< TValue, VLength >::m_InternalArray
private

Internal C array representation.

Definition at line 271 of file itkFixedArray.h.


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