Public Types | Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
ecl::Stencil< const unsigned char * > Class Reference

Stencil variant operating on a raw const unsigned char array. More...

#include <specialisations.hpp>

Public Types

typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 Uses the array's constant reverse iterator type. More...
 
typedef std::ptrdiff_t difference_type
 
typedef std::reverse_iterator< iteratorreverse_iterator
 Uses the array's reverse iterator type. More...
 
typedef std::size_t size_type
 Uses the array's type used to denote the length of the array. More...
 
typedef unsigned char value_type
 Uses the array's element type. More...
 

Public Member Functions

reference at (size_type i)
 
const_reference at (size_type i) const
 
reference back ()
 
const_reference back () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reference front ()
 
const_reference front () 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). More...
 
reference operator[] (size_type i)
 
const_reference operator[] (size_type i) const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
void resettle (const unsigned int &start_index, const unsigned int &n)
 Resettle the stencil on a different range over the same underlying array. More...
 
size_type size () const
 
Stencil< const unsigned char * > stencil (const unsigned int &start_index, const unsigned int &n) const
 Generate a sub-stencil. More...
 
 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. More...
 
 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. More...
 
virtual ~Stencil ()
 

Public Attributes

const typedef unsigned char * const_iterator
 Uses the array's constant iterator type. More...
 
const typedef unsigned char & const_reference
 Uses the array's element const reference type. More...
 
const typedef unsigned char * iterator
 Uses the array's iterator type. More...
 
const typedef unsigned char & reference
 Uses the array's element reference type. More...
 

Private Attributes

const_iterator array
 
const_iterator b_iter
 
const_iterator e_iter
 
unsigned int length
 

Friends

template<typename OutputStream >
OutputStream & operator<< (OutputStream &ostream, const Stencil< const unsigned char * > &stencil)
 Insertion operator for stencils. More...
 

Detailed Description

Stencil variant operating on a raw const unsigned char array.

This of course assumes the user is responsible for range checking on the unsigned char array.

TODO : generalise this for const T*.

See also
ecl::Stencil

Definition at line 459 of file specialisations.hpp.

Member Typedef Documentation

◆ const_reverse_iterator

typedef std::reverse_iterator<const_iterator> ecl::Stencil< const unsigned char * >::const_reverse_iterator

Uses the array's constant reverse iterator type.

Definition at line 475 of file specialisations.hpp.

◆ difference_type

typedef std::ptrdiff_t ecl::Stencil< const unsigned char * >::difference_type

Definition at line 473 of file specialisations.hpp.

◆ reverse_iterator

typedef std::reverse_iterator<iterator> ecl::Stencil< const unsigned char * >::reverse_iterator

Uses the array's reverse iterator type.

Definition at line 474 of file specialisations.hpp.

◆ size_type

typedef std::size_t ecl::Stencil< const unsigned char * >::size_type

Uses the array's type used to denote the length of the array.

Definition at line 472 of file specialisations.hpp.

◆ value_type

typedef unsigned char ecl::Stencil< const unsigned char * >::value_type

Uses the array's element type.

Definition at line 467 of file specialisations.hpp.

Constructor & Destructor Documentation

◆ Stencil() [1/2]

ecl::Stencil< const unsigned char * >::Stencil ( const_iterator  underlying_array,
const unsigned int &  length,
const_iterator  begin_iter,
const_iterator  end_iter 
)
inline

Initialises with a pointer to the underlying array with boundary constraints.

Sets up the underlying storage container along with boundary constraints in the style of stl containers.

Parameters
underlying_array: reference to the underlying array.
length: of the underlying array
begin_iter: start of the stencil window.
end_iter: end of the stencil window.
Exceptions
StandardException : throws if the indices provided are out of range [debug mode only].

Definition at line 494 of file specialisations.hpp.

◆ Stencil() [2/2]

ecl::Stencil< const unsigned char * >::Stencil ( const_iterator  underlying_array,
const unsigned int &  length,
const unsigned int &  start_index = 0,
const unsigned int &  n = 0 
)
inline

Initialises with a reference to the underlying array and boundary constraints.

Sets up the underlying storage container along with boundary constraints in the style of eigen block intialisations.

Parameters
underlying_array: reference to the underlying array.
length: of the underlying array
start_index: start of the stencil window.
n: number of elements to include in the window.
Exceptions
StandardException : throws if the indices provided are out of range [debug mode only].

Definition at line 517 of file specialisations.hpp.

◆ ~Stencil()

virtual ecl::Stencil< const unsigned char * >::~Stencil ( )
inlinevirtual

Definition at line 527 of file specialisations.hpp.

Member Function Documentation

◆ at() [1/2]

reference ecl::Stencil< const unsigned char * >::at ( size_type  i)
inline

Accesses elements in the stencil, returning references to the requested element. This accessor always does range checks. Compare this with the [] accessor which only checks if NDEBUG is not defined.

Parameters
i: the index of the requested element.
Returns
reference : a reference to the requested element.
Exceptions
StandardException : throws if range is requested element is out of range.

Definition at line 764 of file specialisations.hpp.

◆ at() [2/2]

const_reference ecl::Stencil< const unsigned char * >::at ( size_type  i) const
inline

Accesses elements in the stencil, returning references to the requested element. This accessor always does range checks. Compare this with the [] accessor which only checks if NDEBUG is not defined. This also ensures the references are constant, which in turn ensures the contents cannot of the array cannot be modified.

Parameters
i: the index of the requested element.
Returns
const_reference : a const_reference to the requested element.
Exceptions
StandardException : throws if range is requested element is out of range.

Definition at line 788 of file specialisations.hpp.

◆ back() [1/2]

reference ecl::Stencil< const unsigned char * >::back ( )
inline

Generates an reference to the last element in the array.

Returns
reference : reference to the last element in the array.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 703 of file specialisations.hpp.

◆ back() [2/2]

const_reference ecl::Stencil< const unsigned char * >::back ( ) const
inline

Generates a constant reference to the last element in the array (cannot change the value).

Returns
const_reference : const_reference to the last element in the array.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 713 of file specialisations.hpp.

◆ begin() [1/2]

iterator ecl::Stencil< const unsigned char * >::begin ( )
inline

Generates a pointer (iterator) pointing to the start of the stencil.

Returns
iterator : points to the beginning of the stencil.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 599 of file specialisations.hpp.

◆ begin() [2/2]

const_iterator ecl::Stencil< const unsigned char * >::begin ( ) const
inline

Generates a const pointer (iterator) pointing to the start of the array.

Returns
const_iterator : constant pointer (iterator) pointing to the end of the array.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 609 of file specialisations.hpp.

◆ end() [1/2]

iterator ecl::Stencil< const unsigned char * >::end ( )
inline

Generates an pointer (iterator) pointing to the end of the array.

Returns
iterator : points to the end of the array.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 619 of file specialisations.hpp.

◆ end() [2/2]

const_iterator ecl::Stencil< const unsigned char * >::end ( ) const
inline

Generates a const pointer (iterator) pointing to the end of the array.

Returns
const_iterator : constant pointer (iterator) pointing to the end of the array.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 629 of file specialisations.hpp.

◆ front() [1/2]

reference ecl::Stencil< const unsigned char * >::front ( )
inline

Generates an reference to the first element in the array.

Returns
reference : reference to the first element in the array.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 683 of file specialisations.hpp.

◆ front() [2/2]

const_reference ecl::Stencil< const unsigned char * >::front ( ) const
inline

Generates a constant reference to the first element in the array (cannot change the value).

Returns
const_reference : const_reference to the first element in the array.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 693 of file specialisations.hpp.

◆ operator=()

Stencil<const unsigned char*>& ecl::Stencil< const unsigned char * >::operator= ( const Stencil< const unsigned char * > &  s)
inline

This either resettles this stencil or copies across to it (depending on the rhs stencil).

The assignment operator has one of two effects - it will either reassign this stencil if both stencils work on the same underlying array, OR it copies across if acting on two different arrays.

Parameters
s
Returns
Stencil<unsigned char*> : a handle to this stencil
Exceptions
StandardException : if copying from another stencil/array, throws if size exceeded [debug mode only].
See also
Stencil

Definition at line 582 of file specialisations.hpp.

◆ operator[]() [1/2]

reference ecl::Stencil< const unsigned char * >::operator[] ( size_type  i)
inline

Accesses elements in the stencil, returning references to the requested element. This accessor only does range checks in debug mode (NDEBUG is not defined). Compare this with the at() accessor which always checks if the range is exceeded.

Returns
reference : a reference to the requested element.
Exceptions
StandardException : throws if range is requested element is out of range [debug mode only].

Definition at line 731 of file specialisations.hpp.

◆ operator[]() [2/2]

const_reference ecl::Stencil< const unsigned char * >::operator[] ( size_type  i) const
inline

Accesses elements in the stencil, returning references to the requested element. This accessor only does range checks in debug mode (NDEBUG is not defined). Compare this with the at() accessor which always checks if the range is exceeded. This also ensures the references are constant, which in turn ensures the contents cannot of the array cannot be modified.

Returns
const_reference : a constant reference to the requested element.
Exceptions
StandardException : throws if range is requested element is out of range [debug mode only].

Definition at line 748 of file specialisations.hpp.

◆ rbegin() [1/2]

reverse_iterator ecl::Stencil< const unsigned char * >::rbegin ( )
inline

Generates a reverse iterator pointing to the end of the array.

Returns
reverse_iterator : points to the end of the array.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 639 of file specialisations.hpp.

◆ rbegin() [2/2]

const_reverse_iterator ecl::Stencil< const unsigned char * >::rbegin ( ) const
inline

Generates a constant reverse iterator pointing to the end of the array.

Returns
const_reverse_iterator : constant reverse iterator pointing to the end of the array.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 649 of file specialisations.hpp.

◆ rend() [1/2]

reverse_iterator ecl::Stencil< const unsigned char * >::rend ( )
inline

Generates a reverse iterator pointing to the beginning of the array.

Returns
reverse_iterator : points to the beginning of the array.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 659 of file specialisations.hpp.

◆ rend() [2/2]

const_reverse_iterator ecl::Stencil< const unsigned char * >::rend ( ) const
inline

Generates a constant reverse iterator pointing to the beginning of the array.

Returns
const_reverse_iterator : constant reverse iterator pointing to the beginning of the array.
Exceptions
StandardException : throws if the underlying array changed size and the stencil is now out of range [debug mode only].

Definition at line 669 of file specialisations.hpp.

◆ resettle()

void ecl::Stencil< const unsigned char * >::resettle ( const unsigned int &  start_index,
const unsigned int &  n 
)
inline

Resettle the stencil on a different range over the same underlying array.

Resets the range of the stencil operating on the currently referenced array. Using a starting index + size is in line with the way eigen blocks and segments work.

Parameters
start_index: start of the stencil window.
n: number of elements to include in the window.
Exceptions
StandardException : throws if the indices provided are out of range [debug mode only].

Definition at line 561 of file specialisations.hpp.

◆ size()

size_type ecl::Stencil< const unsigned char * >::size ( ) const
inline

The size of the stencil.

Returns
size_type : the size of the stencil.

Definition at line 809 of file specialisations.hpp.

◆ stencil()

Stencil<const unsigned char*> ecl::Stencil< const unsigned char * >::stencil ( const unsigned int &  start_index,
const unsigned int &  n 
) const
inline

Generate a sub-stencil.

Opens another window on this stencil. Using a starting index + size is in line with the way eigen blocks and segments work.

Parameters
start_index: start of the stencil window.
n: number of elements to include in the window.
Returns
Stencil<Array> : the generated sub-stencil.
Exceptions
StandardException : throws if the indices provided are out of range [debug mode only].

Definition at line 542 of file specialisations.hpp.

Friends And Related Function Documentation

◆ operator<<

template<typename OutputStream >
OutputStream& operator<< ( OutputStream &  ostream,
const Stencil< const unsigned char * > &  stencil 
)
friend

Insertion operator for stencils.

Insertion operator for sending the stencil to an output stream. This is raw, and has no formatting.

Concept Check: makes sure the template parameter provided for the stream is a stream type with the required functionality.

Parameters
ostream: the output stream.
stencil: the stencil to be inserted.
Template Parameters
OutputStream: the stream being used.
ArrayType: the type of the underlying array.
Returns
OutputStream : continue streaming with the updated output stream.

Member Data Documentation

◆ array

const_iterator ecl::Stencil< const unsigned char * >::array
private

Definition at line 834 of file specialisations.hpp.

◆ b_iter

const_iterator ecl::Stencil< const unsigned char * >::b_iter
private

Definition at line 836 of file specialisations.hpp.

◆ const_iterator

const typedef unsigned char* ecl::Stencil< const unsigned char * >::const_iterator

Uses the array's constant iterator type.

Definition at line 469 of file specialisations.hpp.

◆ const_reference

const typedef unsigned char& ecl::Stencil< const unsigned char * >::const_reference

Uses the array's element const reference type.

Definition at line 471 of file specialisations.hpp.

◆ e_iter

const_iterator ecl::Stencil< const unsigned char * >::e_iter
private

Definition at line 836 of file specialisations.hpp.

◆ iterator

const typedef unsigned char* ecl::Stencil< const unsigned char * >::iterator

Uses the array's iterator type.

Definition at line 468 of file specialisations.hpp.

◆ length

unsigned int ecl::Stencil< const unsigned char * >::length
private

Definition at line 835 of file specialisations.hpp.

◆ reference

const typedef unsigned char& ecl::Stencil< const unsigned char * >::reference

Uses the array's element reference type.

Definition at line 470 of file specialisations.hpp.


The documentation for this class was generated from the following file:


ecl_containers
Author(s): Daniel Stonier
autogenerated on Wed Mar 2 2022 00:16:34