18 #ifndef itkFixedArray_h
19 #define itkFixedArray_h
50 template<
typename TValue,
unsigned int VLength = 3 >
55 static constexpr
unsigned int Length = VLength;
72 class ConstReverseIterator;
148 template<
typename TFixedArrayValueType >
153 while ( i != this->End() )
155 *i++ =
static_cast< TValue
>( *input++ );
160 template<
typename TScalarValue >
163 std::copy(r, r + this->
Size(), this->GetDataPointer());
167 template<
typename TFixedArrayValueType >
170 if ( (
const void *)r.
Begin() != (
const void *)m_InternalArray )
174 while ( i != this->End() )
176 *i++ =
static_cast< TValue
>( *input++ );
183 FixedArray & operator=(
const ValueType r[VLength]);
203 #if defined( __GNUC__ )
204 #if ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ == 9 ) || ( __GNUC__ >= 7 )
205 #pragma GCC diagnostic push
206 #pragma GCC diagnostic ignored "-Warray-bounds"
211 #if defined( __GNUC__ )
212 #if ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ == 9 ) || ( __GNUC__ >= 7 )
213 #pragma GCC diagnostic pop
228 { m_InternalArray[index] = value; }
235 return m_InternalArray; \
240 return m_InternalArray; \
246 ConstIterator Begin()
const;
250 ConstIterator End()
const;
252 ReverseIterator rBegin();
254 ConstReverseIterator rBegin()
const;
256 ReverseIterator rEnd();
258 ConstReverseIterator rEnd()
const;
262 void Fill(
const ValueType &);
266 std::swap_ranges(this->Begin(), this->End(), other.
Begin());
278 template<
typename TValue,
unsigned int VLength >
279 std::ostream & operator<<(std::ostream & os, const FixedArray< TValue, VLength > & arr);
282 template<
typename TValue,
unsigned int VLength >
290 #ifndef ITK_MANUAL_INSTANTIATION
291 #include "itkFixedArray.hxx"
void swap(FixedArray &other)
ReverseIterator(Iterator i)
reference operator[](long index)
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
ConstReverseIterator(ConstIterator i)
const_reference operator[](unsigned short index) const
A const reverse iterator through an array.
bool operator==(const ConstReverseIterator &rit) const
ConstIterator operator--(int)
ConstReverseIterator(const ReverseIterator &rit)
reference operator[](short index)
const_reference GetElement(unsigned short index) const
reference operator[](int index)
ConstIterator operator++()
bool operator!=(const FixedArray &r) const
reference operator[](unsigned int index)
FixedArray(const TScalarValue *r)
constexpr unsigned int Dimension
ConstIterator operator--()
const_reference operator[](long long index) const
bool operator==(const ReverseIterator &rit) const
Simulate a standard C array with copy semnatics.
void swap(Array< T > &a, Array< T > &b)
reference operator[](unsigned short index)
reference operator[](long long index)
bool operator!=(const ReverseIterator &rit) const
const_reference operator[](short index) const
ConstIterator operator++(int)
void SetElement(unsigned short index, const_reference value)
A reverse iterator through an array.
ImageBaseType::SizeType SizeType
const_reference operator[](long index) const
const ValueType * const_pointer
const_reference operator[](unsigned long index) const
Represent a n-dimensional size (bounds) of a n-dimensional image.
bool operator!=(const ConstReverseIterator &rit) const
const_reference operator[](unsigned long long index) const
const_reference operator[](unsigned int index) const
FixedArray & operator=(const FixedArray< TFixedArrayValueType, VLength > &r)
const ValueType & const_reference
Iterator operator->() const
const_reference operator[](int index) const
FixedArray(const FixedArray< TFixedArrayValueType, VLength > &r)
reference operator[](unsigned long long index)
ValueType * GetDataPointer()
ConstIterator operator->() const
const ValueType & operator*() const
const ValueType * GetDataPointer() const
const ValueType * ConstIterator
reference operator[](unsigned long index)
ValueType & operator*() const