10 #ifndef ecl_containers_SPECIALISATIONS_HPP_ 11 #define ecl_containers_SPECIALISATIONS_HPP_ 45 typedef unsigned char value_type;
46 typedef unsigned char* iterator;
47 typedef const unsigned char* const_iterator;
48 typedef unsigned char& reference;
49 typedef const unsigned char& const_reference;
50 typedef std::size_t size_type;
51 typedef std::ptrdiff_t difference_type;
52 typedef std::reverse_iterator<iterator> reverse_iterator;
53 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
72 Stencil(iterator underlying_array,
const unsigned int& length, iterator begin_iter, iterator end_iter)
ecl_assert_throw_decl(StandardException) :
73 array(underlying_array),
95 Stencil(iterator underlying_array,
const unsigned int& length,
const unsigned int& start_index = 0,
const unsigned int &n = 0)
ecl_assert_throw_decl(StandardException) :
96 array(underlying_array),
98 b_iter(array+start_index),
99 e_iter(array+start_index+n)
120 Stencil<unsigned char*> stencil(
const unsigned int& start_index,
const unsigned int& n)
const ecl_assert_throw_decl(StandardException)
123 ecl_assert_throw( b_iter+start_index+n <= array+length, StandardException(
LOC,
OutOfRangeError,
"Finish index provided is larger than the underlying stencil size."));
125 return Stencil<unsigned char*>(
array,length,b_iter+start_index,b_iter+start_index+n);
139 void resettle(
const unsigned int& start_index,
const unsigned int& n)
ecl_assert_throw_decl(StandardException)
142 b_iter =
array+start_index;
143 e_iter =
array+start_index+n;
164 containers::BoundedListInitialiser<value_type,iterator>
operator<< (
const value_type &value)
166 return containers::BoundedListInitialiser<value_type,iterator>(value, begin(),
size());
181 Stencil<unsigned char*>& operator=(
const Stencil<unsigned char*> &s)
ecl_assert_throw_decl(StandardException)
241 return reverse_iterator(end());
251 return const_reverse_iterator(end());
261 return reverse_iterator(begin());
271 return const_reverse_iterator(begin());
363 reference at(size_type i)
throw(StandardException)
365 if ( b_iter+i <= array )
369 if ( b_iter+i >= array+length )
387 const_reference at(size_type i)
const throw(StandardException)
389 if ( b_iter+i <= array )
393 if ( b_iter+i >= array+length )
408 size_type
size()
const 409 {
return e_iter-b_iter;}
429 template <
typename OutputStream>
430 friend OutputStream& operator<<(OutputStream &ostream , const Stencil<unsigned char*> &stencil);
435 iterator b_iter, e_iter;
453 class ECL_PUBLIC Stencil<const unsigned char*>
459 typedef unsigned char value_type;
460 typedef const unsigned char* iterator;
461 typedef const unsigned char* const_iterator;
462 typedef const unsigned char& reference;
463 typedef const unsigned char& const_reference;
464 typedef std::size_t size_type;
465 typedef std::ptrdiff_t difference_type;
466 typedef std::reverse_iterator<iterator> reverse_iterator;
467 typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
486 Stencil(const_iterator underlying_array,
const unsigned int& length, const_iterator begin_iter, const_iterator end_iter)
ecl_assert_throw_decl(StandardException) :
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)
ecl_assert_throw_decl(StandardException) :
510 array(underlying_array),
512 b_iter(array+start_index),
513 e_iter(array+start_index+n)
534 Stencil<const unsigned char*> stencil(
const unsigned int& start_index,
const unsigned int& n)
const ecl_assert_throw_decl(StandardException)
537 ecl_assert_throw( b_iter+start_index+n <= array+length, StandardException(
LOC,
OutOfRangeError,
"Finish index provided is larger than the underlying stencil size."));
539 return Stencil<const unsigned char*>(
array,length,b_iter+start_index,b_iter+start_index+n);
553 void resettle(
const unsigned int& start_index,
const unsigned int& n)
ecl_assert_throw_decl(StandardException)
556 b_iter =
array+start_index;
557 e_iter =
array+start_index+n;
574 Stencil<const unsigned char*>& operator=(
const Stencil<const unsigned char*> &s)
ecl_assert_throw_decl(StandardException)
634 return reverse_iterator(end());
644 return const_reverse_iterator(end());
654 return reverse_iterator(begin());
664 return const_reverse_iterator(begin());
756 reference at(size_type i)
throw(StandardException)
758 if ( b_iter+i <= array )
762 if ( b_iter+i >= array+length )
780 const_reference at(size_type i)
const throw(StandardException)
782 if ( b_iter+i <= array )
786 if ( b_iter+i >= array+length )
801 size_type
size()
const 802 {
return e_iter-b_iter;}
822 template <
typename OutputStream>
823 friend OutputStream& operator<<(OutputStream &ostream , const Stencil<const unsigned char*> &stencil);
826 const_iterator
array;
828 const_iterator b_iter, e_iter;
#define LOC
Stringify the line of code you are at.
OutputStream & operator<<(OutputStream &ostream, const Void void_object)
Output stream operator for Void objects.
#define ecl_assert_throw(expression, exception)
Debug mode throw with a logical condition check.
ecl_geometry_PUBLIC int size(const Trajectory2D &trajectory)
#define ecl_assert_throw_decl(exception)
Assure throw exception declaration.
Windows over ecl type containers.
TFSIMD_FORCE_INLINE tfScalar length(const Quaternion &q)