18 #ifndef itkFixedArray_h
19 #define itkFixedArray_h
49 template<
typename TValue,
unsigned int VLength = 3 >
54 itkStaticConstMacro(Length,
unsigned int, VLength);
57 itkStaticConstMacro(
Dimension,
unsigned int, VLength);
71 class ConstReverseIterator;
139 template<
typename TFixedArrayValueType >
144 while ( i != this->End() )
146 *i++ =
static_cast< TValue
>( *input++ );
151 template<
typename TScalarValue >
154 std::copy(r, r + this->
Size(), this->GetDataPointer());
171 template<
typename TFixedArrayValueType >
174 if ( (
const void *)r.
Begin() != (
const void *)m_InternalArray )
178 while ( i != this->End() )
180 *i++ =
static_cast< TValue
>( *input++ );
187 FixedArray & operator=(
const ValueType r[VLength]);
207 #if defined( __GNUC__ )
208 #if ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ == 9 ) || ( __GNUC__ >= 7 )
209 #pragma GCC diagnostic push
210 #pragma GCC diagnostic ignored "-Warray-bounds"
215 #if defined( __GNUC__ )
216 #if ( __GNUC__ == 4 ) && ( __GNUC_MINOR__ == 9 ) || ( __GNUC__ >= 7 )
217 #pragma GCC diagnostic pop
232 { m_InternalArray[index] = value; }
239 return m_InternalArray; \
244 return m_InternalArray; \
250 ConstIterator Begin()
const;
254 ConstIterator End()
const;
256 ReverseIterator rBegin();
258 ConstReverseIterator rBegin()
const;
260 ReverseIterator rEnd();
262 ConstReverseIterator rEnd()
const;
266 void Fill(
const ValueType &);
277 template<
typename TValue,
unsigned int VLength >
278 std::ostream & operator<<(std::ostream & os, const FixedArray< TValue, VLength > & arr);
281 #ifndef ITK_MANUAL_INSTANTIATION
282 #include "itkFixedArray.hxx"
ReverseIterator(Iterator i)
reference operator[](long index)
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)
Represent the size (bounds) of a n-dimensional image.
reference operator[](short index)
const_reference GetElement(unsigned short index) const
reference operator[](int index)
ConstIterator operator++()
bool operator!=(const FixedArray &r) const
const ValueType * const_pointer
reference operator[](unsigned int index)
FixedArray(const TScalarValue *r)
const ValueType & const_reference
ConstIterator operator--()
const_reference operator[](long long index) const
bool operator==(const ReverseIterator &rit) const
Simulate a standard C array with copy semnatics.
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.
const_reference operator[](long index) const
const_reference operator[](unsigned long index) const
bool operator!=(const ConstReverseIterator &rit) const
const_reference operator[](unsigned long long index) const
const unsigned int Dimension
const_reference operator[](unsigned int index) const
FixedArray & operator=(const FixedArray< TFixedArrayValueType, VLength > &r)
Iterator operator->() const
const_reference operator[](int index) const
FixedArray(const FixedArray< TFixedArrayValueType, VLength > &r)
reference operator[](unsigned long long index)
ImageBaseType::SizeType SizeType
ValueType * GetDataPointer()
ConstIterator operator->() const
const ValueType & operator*() const
const ValueType * GetDataPointer() const
bool ITKIOXML_EXPORT operator==(itk::FancyString &s, const std::string &)
reference operator[](unsigned long index)
const ValueType * ConstIterator
ValueType & operator*() const