18#ifndef itkFixedArray_h
19#define itkFixedArray_h
52template <
typename TValue,
unsigned int VLength = 3>
57 static constexpr unsigned int Length = VLength;
208 explicit FixedArray(
const std::array<ValueType, VLength> & stdArray)
210 std::copy_n(stdArray.cbegin(), VLength, m_InternalArray);
214 template <
typename TFixedArrayValueType>
219 for (
auto & element : m_InternalArray)
221 element =
static_cast<TValue
>(*input++);
225 template <
typename TScalarValue>
228 std::copy_n(r, VLength, m_InternalArray);
237 template <
typename TFixedArrayValueType>
243 for (
auto & element : m_InternalArray)
245 element =
static_cast<TValue
>(*input++);
266 ITK_GCC_SUPPRESS_Warray_bounds
276 m_InternalArray[index] = value;
281 return m_InternalArray[index];
289 return m_InternalArray;
295 return m_InternalArray;
301 return m_InternalArray;
307 return m_InternalArray;
341 return m_InternalArray;
347 return m_InternalArray;
350 constexpr const_iterator
353 return this->cbegin();
356 constexpr const_iterator
359 return m_InternalArray + VLength;
365 return m_InternalArray + VLength;
368 constexpr const_iterator
380 const_reverse_iterator
386 const_reverse_iterator
389 return this->crbegin();
398 const_reverse_iterator
404 const_reverse_iterator
407 return this->crend();
439 return MakeFilled<FixedArray>(value);
444template <
typename TValue,
unsigned int VLength>
449template <
typename TValue,
unsigned int VLength>
458#ifndef ITK_MANUAL_INSTANTIATION
459# include "itkFixedArray.hxx"
A const reverse iterator through an array.
ConstReverseIterator operator--(int)
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(ConstReverseIterator)
ConstReverseIterator(ConstIterator i)
ConstReverseIterator operator--()
ConstReverseIterator operator++()
const ValueType & operator*() const
ConstReverseIterator(const ReverseIterator &rit)
ConstIterator operator->() const
ConstReverseIterator operator++(int)
bool operator==(const ConstReverseIterator &rit) const
A reverse iterator through an array.
bool operator==(const ReverseIterator &rit) const
ReverseIterator operator--()
ReverseIterator operator++()
ReverseIterator operator--(int)
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(ReverseIterator)
ReverseIterator(Iterator i)
Iterator operator->() const
ValueType & operator*() const
ReverseIterator operator++(int)
Simulate a standard C array with copy semantics.
ConstIterator End() const
bool operator==(const FixedArray &r) const
constexpr SizeType size() const
const ValueType * const_iterator
std::reverse_iterator< iterator > reverse_iterator
constexpr const_reference operator[](unsigned int index) const
const_reverse_iterator crend() const
FixedArray(const ValueType r[VLength])
const ValueType * GetDataPointer() const
constexpr iterator begin() noexcept
void swap(FixedArray &other)
FixedArray(const ValueType &)
constexpr const_iterator cbegin() const noexcept
const ValueType * data() const
ValueType * GetDataPointer()
FixedArray(const std::array< ValueType, VLength > &stdArray)
const ValueType * ConstIterator
ValueType[VLength] CArray
const_reverse_iterator crbegin() const
constexpr iterator end() noexcept
reverse_iterator rbegin()
itkLegacyMacro(ReverseIterator rEnd();) itkLegacyMacro(ConstReverseIterator rEnd() const
FixedArray(const TScalarValue *r)
static constexpr FixedArray Filled(const ValueType &value)
const_reverse_iterator rend() const
const_reference GetElement(unsigned int index) const
constexpr const_iterator cend() const noexcept
FixedArray & operator=(const FixedArray< TFixedArrayValueType, VLength > &r)
std::reverse_iterator< const_iterator > const_reverse_iterator
const ValueType & const_reference
FixedArray & operator=(const ValueType r[VLength])
constexpr const_iterator begin() const noexcept
ITK_GCC_PRAGMA_PUSH ITK_GCC_SUPPRESS_Warray_bounds constexpr reference operator[](unsigned int index)
constexpr const_iterator end() const noexcept
ConstIterator Begin() const
ITK_UNEQUAL_OPERATOR_MEMBER_FUNCTION(FixedArray)
const ValueType * const_pointer
const_reverse_iterator rbegin() const
FixedArray(const FixedArray< TFixedArrayValueType, VLength > &r)
ITK_GCC_PRAGMA_POP void SetElement(unsigned int index, const_reference value)
void Fill(const ValueType &)
itkLegacyMacro(ReverseIterator rBegin();) itkLegacyMacro(ConstReverseIterator rBegin() const
constexpr unsigned int Dimension
ImageBaseType::SizeType SizeType
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
void swap(Array< T > &a, Array< T > &b) noexcept
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
void swap(FixedArray< TValue, VLength > &a, FixedArray< TValue, VLength > &b)