18#ifndef itkFixedArray_h
19#define itkFixedArray_h
52template <
typename TValue,
unsigned int VLength = 3>
57 static constexpr unsigned int Length = VLength;
109 return (m_Iterator - 1);
114 return *(m_Iterator - 1);
164 return (m_Iterator - 1);
169 return *(m_Iterator - 1);
224 explicit FixedArray(
const std::array<ValueType, VLength> & stdArray)
226 std::copy_n(stdArray.cbegin(), VLength, m_InternalArray);
230 template <
typename TFixedArrayValueType>
235 for (
auto & element : m_InternalArray)
237 element =
static_cast<TValue
>(*input++);
241 template <
typename TScalarValue>
244 std::copy_n(r, VLength, m_InternalArray);
253 template <
typename TFixedArrayValueType>
259 for (
auto & element : m_InternalArray)
261 element =
static_cast<TValue
>(*input++);
282 ITK_GCC_SUPPRESS_Warray_bounds
286 return m_InternalArray[index];
288 constexpr const_reference
291 return m_InternalArray[index];
300 m_InternalArray[index] = value;
305 return m_InternalArray[index];
313 return m_InternalArray;
319 return m_InternalArray;
325 return m_InternalArray;
331 return m_InternalArray;
365 return m_InternalArray;
371 return m_InternalArray;
374 constexpr const_iterator
377 return this->cbegin();
380 constexpr const_iterator
383 return m_InternalArray + VLength;
389 return m_InternalArray + VLength;
392 constexpr const_iterator
404 const_reverse_iterator
410 const_reverse_iterator
413 return this->crbegin();
422 const_reverse_iterator
428 const_reverse_iterator
431 return this->crend();
451 std::swap(m_InternalArray, other.m_InternalArray);
463 return MakeFilled<FixedArray>(value);
468template <
typename TValue,
unsigned int VLength>
473template <
typename TValue,
unsigned int VLength>
482#ifndef ITK_MANUAL_INSTANTIATION
483# 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
void swap(FixedArray &other) noexcept
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
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
void swap(FixedArray< TValue, VLength > &a, FixedArray< TValue, VLength > &b) noexcept
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)