10 #ifndef ecl_containers_SPECIALISATIONS_HPP_ 11 #define ecl_containers_SPECIALISATIONS_HPP_ 72 Stencil(iterator underlying_array,
const unsigned int& length, iterator begin_iter, iterator end_iter) :
73 array(underlying_array),
95 Stencil(iterator underlying_array,
const unsigned int& length,
const unsigned int& start_index = 0,
const unsigned int &n = 0) :
96 array(underlying_array),
98 b_iter(array+start_index),
99 e_iter(array+start_index+n)
139 void resettle(
const unsigned int& start_index,
const unsigned int& n)
142 b_iter = array+start_index;
143 e_iter = array+start_index+n;
228 const_iterator
end()
const 241 return reverse_iterator(end());
251 return const_reverse_iterator(end());
261 return reverse_iterator(begin());
268 const_reverse_iterator
rend()
const 271 return const_reverse_iterator(begin());
363 reference
at(size_type i)
365 if ( b_iter+i <= array )
369 if ( b_iter+i >= array+length )
387 const_reference
at(size_type i)
const 389 if ( b_iter+i <= array )
393 if ( b_iter+i >= array+length )
409 {
return e_iter-b_iter;}
429 template <
typename OutputStream>
430 friend OutputStream& operator<<(OutputStream &ostream , const Stencil<unsigned char*> &stencil);
486 Stencil(const_iterator underlying_array,
const unsigned int& length, const_iterator begin_iter, const_iterator end_iter) :
487 array(underlying_array),
509 Stencil(const_iterator underlying_array,
const unsigned int& length,
const unsigned int& start_index = 0,
const unsigned int &n = 0) :
510 array(underlying_array),
512 b_iter(array+start_index),
513 e_iter(array+start_index+n)
553 void resettle(
const unsigned int& start_index,
const unsigned int& n)
556 b_iter = array+start_index;
557 e_iter = array+start_index+n;
621 const_iterator
end()
const 634 return reverse_iterator(end());
644 return const_reverse_iterator(end());
654 return reverse_iterator(begin());
661 const_reverse_iterator
rend()
const 664 return const_reverse_iterator(begin());
756 reference
at(size_type i)
758 if ( b_iter+i <= array )
762 if ( b_iter+i >= array+length )
780 const_reference
at(size_type i)
const 782 if ( b_iter+i <= array )
786 if ( b_iter+i >= array+length )
802 {
return e_iter-b_iter;}
822 template <
typename OutputStream>
823 friend OutputStream& operator<<(OutputStream &ostream , const Stencil<const unsigned char*> &stencil);
const unsigned char * const_iterator
Uses the array's constant iterator type.
const_reverse_iterator rend() const
unsigned char & reference
Uses the array's element reference type.
unsigned char * iterator
Uses the array's iterator type.
Stencil(iterator underlying_array, const unsigned int &length, const unsigned int &start_index=0, const unsigned int &n=0)
Initialises with a reference to the underlying array and boundary constraints.
Stencil< const unsigned char * > stencil(const unsigned int &start_index, const unsigned int &n) const
Generate a sub-stencil.
void resettle(const unsigned int &start_index, const unsigned int &n)
Resettle the stencil on a different range over the same underlying array.
const unsigned char & const_reference
Uses the array's element const reference type.
Stencil< unsigned char * > stencil(const unsigned int &start_index, const unsigned int &n) const
Generate a sub-stencil.
reference operator[](size_type i)
unsigned char value_type
Uses the array's element type.
Embedded control libraries.
reference at(size_type i)
std::reverse_iterator< const_iterator > const_reverse_iterator
Uses the array's constant reverse iterator type.
Stencil(const_iterator underlying_array, const unsigned int &length, const_iterator begin_iter, const_iterator end_iter)
Initialises with a pointer to the underlying array with boundary constraints.
OutputStream & operator<<(OutputStream &ostream, Format< std::string > &formatter)
const_reference front() const
const unsigned char & reference
Uses the array's element reference type.
const_iterator begin() const
reverse_iterator rbegin()
std::size_t size_type
Uses the array's type used to denote the length of the array.
std::reverse_iterator< iterator > reverse_iterator
Uses the array's reverse iterator type.
const unsigned char * const_iterator
Uses the array's constant iterator type.
reference at(size_type i)
Stencil< unsigned char * > & operator=(const Stencil< unsigned char *> &s)
This either resettles this stencil or copies across to it (depending on the rhs stencil).
const_reference at(size_type i) const
unsigned char value_type
Uses the array's element type.
#define ecl_assert_throw(expression, exception)
const_iterator begin() const
const_reference operator[](size_type i) const
const unsigned char & const_reference
Uses the array's element const reference type.
std::ptrdiff_t difference_type
const_iterator end() const
const_reverse_iterator rbegin() const
reverse_iterator rbegin()
const_reverse_iterator rend() const
Stencil< const unsigned char * > & operator=(const Stencil< const unsigned char *> &s)
This either resettles this stencil or copies across to it (depending on the rhs stencil).
const unsigned char * iterator
Uses the array's iterator type.
const_reference operator[](size_type i) const
Convenience initialiser with bounds checking for fixed size containers.
std::size_t size_type
Uses the array's type used to denote the length of the array.
std::reverse_iterator< iterator > reverse_iterator
Uses the array's reverse iterator type.
A safe windowing class that opens onto array-like containers.
Stencil(const_iterator underlying_array, const unsigned int &length, const unsigned int &start_index=0, const unsigned int &n=0)
Initialises with a reference to the underlying array and boundary constraints.
std::reverse_iterator< const_iterator > const_reverse_iterator
Uses the array's constant reverse iterator type.
const_reference back() const
const_reference back() const
Stencil(iterator underlying_array, const unsigned int &length, iterator begin_iter, iterator end_iter)
Initialises with a pointer to the underlying array with boundary constraints.
Windows over ecl type containers.
const_iterator end() const
const_reference at(size_type i) const
reference operator[](size_type i)
void resettle(const unsigned int &start_index, const unsigned int &n)
Resettle the stencil on a different range over the same underlying array.
const_reverse_iterator rbegin() const
const_reference front() const
std::ptrdiff_t difference_type