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

#include <itkFixedArray.h>

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

Classes

class  ConstReverseIterator
 
class  ReverseIterator
 

Public Types

using CArray = ValueType[VLength]
 
using const_iterator = const ValueType *
 
using const_pointer = const ValueType *
 
using const_reference = const ValueType &
 
using const_reverse_iterator = std::reverse_iterator< const_iterator >
 
using ConstIterator = const ValueType *
 
using Iterator = ValueType *
 
using iterator = ValueType *
 
using pointer = ValueType *
 
using reference = ValueType &
 
using reverse_iterator = std::reverse_iterator< iterator >
 
using SizeType = unsigned int
 
using ValueType = TValue
 

Public Member Functions

Iterator Begin ()
 
ConstIterator Begin () const
 
constexpr const_iterator begin () const noexcept
 
constexpr iterator begin () noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr const_iterator cend () const noexcept
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 
ValueTypedata ()
 
const ValueTypedata () const
 
Iterator End ()
 
ConstIterator End () const
 
constexpr const_iterator end () const noexcept
 
constexpr iterator end () noexcept
 
void Fill (const ValueType &)
 
 FixedArray ()=default
 
template<typename TFixedArrayValueType >
 FixedArray (const FixedArray< TFixedArrayValueType, VLength > &r)
 
 FixedArray (const std::array< ValueType, VLength > &stdArray)
 
template<typename TScalarValue >
 FixedArray (const TScalarValue *r)
 
ValueTypeGetDataPointer ()
 
const ValueTypeGetDataPointer () const
 
 ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION (FixedArray)
 
 itkLegacyMacro (ConstReverseIterator rBegin() const)
 
 itkLegacyMacro (ConstReverseIterator rEnd() const)
 
 itkLegacyMacro (ReverseIterator rBegin())
 
 itkLegacyMacro (ReverseIterator rEnd())
 
template<typename TFixedArrayValueType >
FixedArrayoperator= (const FixedArray< TFixedArrayValueType, VLength > &r)
 
FixedArrayoperator= (const ValueType r[VLength])
 
bool operator== (const FixedArray &r) const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
SizeType Size () const
 
constexpr SizeType size () const
 
void swap (FixedArray &other)
 
 FixedArray (const ValueType r[VLength])
 
 FixedArray (const ValueType &)
 
constexpr reference operator[] (unsigned int index)
 
constexpr const_reference operator[] (unsigned int index) const
 
void SetElement (unsigned int index, const_reference value)
 
const_reference GetElement (unsigned int index) const
 

Static Public Member Functions

static constexpr FixedArray Filled (const ValueType &value)
 

Static Public Attributes

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

Private Attributes

CArray m_InternalArray
 

Detailed Description

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

Simulate a standard C array with copy semantics.

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

ITK Sphinx Examples:
Examples
Examples/Statistics/ImageToListSampleAdaptor.cxx, Examples/Statistics/PointSetToAdaptor.cxx, Examples/Statistics/ScalarImageMarkovRandomField1.cxx, SphinxExamples/src/Core/Common/CreateAFixedArray/Code.cxx, SphinxExamples/src/Core/Transform/ScaleAnImage/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/Create3DVolume/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/Stack2DImagesInto3DImage/Code.cxx, SphinxExamples/src/Filtering/ImageGrid/TileImagesSideBySide/Code.cxx, and SphinxExamples/src/Numerics/Statistics/CreateListOfSamplesFromImageWithoutDuplication/Code.cxx.

Definition at line 53 of file itkFixedArray.h.

Member Typedef Documentation

◆ CArray

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

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

Definition at line 66 of file itkFixedArray.h.

◆ const_iterator

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

The return type of cbegin() and cend(), and the const overloads of begin() and end().

Definition at line 184 of file itkFixedArray.h.

◆ const_pointer

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 172 of file itkFixedArray.h.

◆ const_reference

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 178 of file itkFixedArray.h.

◆ const_reverse_iterator

template<typename TValue, unsigned int VLength = 3>
using itk::FixedArray< TValue, VLength >::const_reverse_iterator = std::reverse_iterator<const_iterator>

Definition at line 188 of file itkFixedArray.h.

◆ ConstIterator

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

A const iterator through the array.

Definition at line 72 of file itkFixedArray.h.

◆ Iterator

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

An iterator through the array.

Definition at line 69 of file itkFixedArray.h.

◆ iterator

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

The return type of the non-const overloads of begin() and end().

Definition at line 181 of file itkFixedArray.h.

◆ pointer

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

A pointer to the ValueType.

Definition at line 169 of file itkFixedArray.h.

◆ reference

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

A reference to the ValueType.

Definition at line 175 of file itkFixedArray.h.

◆ reverse_iterator

template<typename TValue, unsigned int VLength = 3>
using itk::FixedArray< TValue, VLength >::reverse_iterator = std::reverse_iterator<iterator>

Definition at line 186 of file itkFixedArray.h.

◆ SizeType

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

Definition at line 190 of file itkFixedArray.h.

◆ ValueType

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 63 of file itkFixedArray.h.

Constructor & Destructor Documentation

◆ FixedArray() [1/6]

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

Default-constructor.

Note
The other five "special member functions" are defaulted implicitly, following the C++ "Rule of Zero".

◆ FixedArray() [2/6]

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

Conversion constructors

◆ FixedArray() [3/6]

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

Conversion constructors

◆ FixedArray() [4/6]

template<typename TValue, unsigned int VLength = 3>
itk::FixedArray< TValue, VLength >::FixedArray ( const std::array< ValueType, VLength > &  stdArray)
inlineexplicit

Explicit constructor for std::array.

Definition at line 203 of file itkFixedArray.h.

◆ FixedArray() [5/6]

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 210 of file itkFixedArray.h.

◆ FixedArray() [6/6]

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

Definition at line 221 of file itkFixedArray.h.

Member Function Documentation

◆ Begin() [1/2]

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

Get various iterators to the array.

Referenced by itk::CopyMeshToMeshPoints().

◆ Begin() [2/2]

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

◆ begin() [1/2]

template<typename TValue, unsigned int VLength = 3>
constexpr const_iterator itk::FixedArray< TValue, VLength >::begin ( ) const
inlineconstexprnoexcept

Definition at line 342 of file itkFixedArray.h.

◆ begin() [2/2]

template<typename TValue, unsigned int VLength = 3>
constexpr iterator itk::FixedArray< TValue, VLength >::begin ( )
inlineconstexprnoexcept

Definition at line 336 of file itkFixedArray.h.

◆ cbegin()

template<typename TValue, unsigned int VLength = 3>
constexpr const_iterator itk::FixedArray< TValue, VLength >::cbegin ( ) const
inlineconstexprnoexcept

◆ cend()

template<typename TValue, unsigned int VLength = 3>
constexpr const_iterator itk::FixedArray< TValue, VLength >::cend ( ) const
inlineconstexprnoexcept

Definition at line 348 of file itkFixedArray.h.

◆ crbegin()

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

Definition at line 372 of file itkFixedArray.h.

◆ crend()

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

Definition at line 390 of file itkFixedArray.h.

◆ data() [1/2]

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

Definition at line 297 of file itkFixedArray.h.

◆ data() [2/2]

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

Definition at line 303 of file itkFixedArray.h.

◆ End() [1/2]

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

◆ End() [2/2]

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

◆ end() [1/2]

template<typename TValue, unsigned int VLength = 3>
constexpr const_iterator itk::FixedArray< TValue, VLength >::end ( ) const
inlineconstexprnoexcept

Definition at line 360 of file itkFixedArray.h.

◆ end() [2/2]

template<typename TValue, unsigned int VLength = 3>
constexpr iterator itk::FixedArray< TValue, VLength >::end ( )
inlineconstexprnoexcept

Definition at line 354 of file itkFixedArray.h.

◆ Fill()

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

◆ Filled()

template<typename TValue, unsigned int VLength = 3>
static constexpr FixedArray itk::FixedArray< TValue, VLength >::Filled ( const ValueType value)
inlinestaticconstexpr

Return an FixedArray with the given value assigned to all elements.

Definition at line 428 of file itkFixedArray.h.

◆ GetDataPointer() [1/2]

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

◆ GetDataPointer() [2/2]

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

Definition at line 291 of file itkFixedArray.h.

◆ GetElement()

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

Set/Get element methods are more convenient in wrapping languages

Definition at line 277 of file itkFixedArray.h.

◆ ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION()

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

◆ itkLegacyMacro() [1/4]

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

◆ itkLegacyMacro() [2/4]

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

◆ itkLegacyMacro() [3/4]

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

◆ itkLegacyMacro() [4/4]

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

◆ operator=() [1/2]

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 229 of file itkFixedArray.h.

◆ operator=() [2/2]

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

◆ operator==()

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.

◆ operator[]() [1/2]

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

Allow the FixedArray to be indexed normally. No bounds checking is done.

Definition at line 261 of file itkFixedArray.h.

◆ operator[]() [2/2]

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

Allow the FixedArray to be indexed normally. No bounds checking is done.

Definition at line 262 of file itkFixedArray.h.

◆ rbegin() [1/2]

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

Definition at line 366 of file itkFixedArray.h.

◆ rbegin() [2/2]

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

Definition at line 378 of file itkFixedArray.h.

◆ rend() [1/2]

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

Definition at line 384 of file itkFixedArray.h.

◆ rend() [2/2]

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

Definition at line 396 of file itkFixedArray.h.

◆ SetElement()

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

Set/Get element methods are more convenient in wrapping languages

Definition at line 272 of file itkFixedArray.h.

◆ Size()

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

Size of the container

◆ size()

template<typename TValue, unsigned int VLength = 3>
constexpr SizeType itk::FixedArray< TValue, VLength >::size ( ) const
inlineconstexpr

Definition at line 406 of file itkFixedArray.h.

◆ swap()

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

Definition at line 416 of file itkFixedArray.h.

Referenced by itk::swap().

Member Data Documentation

◆ Dimension

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

Dimension constant

Definition at line 60 of file itkFixedArray.h.

◆ Length

template<typename TValue, unsigned int VLength = 3>
constexpr unsigned int itk::FixedArray< TValue, VLength >::Length = VLength
staticconstexpr

Length constant

Definition at line 57 of file itkFixedArray.h.

◆ m_InternalArray

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

Internal C array representation.

Definition at line 423 of file itkFixedArray.h.

Referenced by itk::FixedArray< TOutput, VPointDimension >::swap().


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