Public Types | Public Member Functions | Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
ecl::Array< Type, DynamicStorage > Class Template Reference

Dynamic size container with a few bells and whistles. More...

#include <array_dynamic_mem_check.hpp>

Inheritance diagram for ecl::Array< Type, DynamicStorage >:
Inheritance graph
[legend]

Public Types

typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef std::reverse_iterator< const_iteratorconst_reverse_iterator
 
typedef std::ptrdiff_t difference_type
 
typedef std::ptrdiff_t difference_type
 
typedef BluePrintFactory< Array< Type, DynamicStorage > > Factory
 Generates blueprints for this class. More...
 
typedef BluePrintFactory< Array< Type, DynamicStorage > > Factory
 Generates blueprints for this class. More...
 
typedef formatters::ArrayFormatter< Type, DynamicStorageFormatter
 Formatter for this class. More...
 
typedef formatters::ArrayFormatter< Type, DynamicStorageFormatter
 Formatter for this class. More...
 
typedef Type * iterator
 
typedef Type * iterator
 
typedef Type & reference
 
typedef Type & reference
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::reverse_iterator< iteratorreverse_iterator
 
typedef std::size_t size_type
 
typedef std::size_t size_type
 
typedef Type value_type
 
typedef Type value_type
 

Public Member Functions

 Array ()
 Default constructor. More...
 
 Array ()
 Default constructor. More...
 
 Array (const Array< Type, DynamicStorage > &array)
 Copy constructor. More...
 
 Array (const Array< Type, DynamicStorage > &array)
 Copy constructor. More...
 
template<typename T >
 Array (const blueprints::ArrayBluePrint< T > &blueprint)
 Blueprint constructor. More...
 
template<typename T >
 Array (const blueprints::ArrayBluePrint< T > &blueprint)
 Blueprint constructor. More...
 
 Array (const unsigned int reserve_size)
 Reserves storage for the array. More...
 
 Array (const unsigned int reserve_size)
 Reserves storage for the array. More...
 
reference at (size_type i)
 
reference at (size_type i)
 
const_reference at (size_type i) const
 
const_reference at (size_type i) const
 
reference back ()
 
reference back ()
 
const_reference back () const
 
const_reference back () const
 
iterator begin ()
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator begin () const
 
bool bufferOverFlow ()
 Manual handle to check for buffer under/over runs simultaneously. More...
 
bool bufferOverRun ()
 Manual handle to check for buffer overruns. More...
 
bool bufferUnderRun ()
 Manual handle to check for buffer underruns. More...
 
void clear ()
 Clear the array, deleting all storage space previously allocated. More...
 
void clear ()
 Clear the array, deleting all storage space previously allocated. More...
 
iterator end ()
 
iterator end ()
 
const_iterator end () const
 
const_iterator end () const
 
reference front ()
 
reference front ()
 
const_reference front () const
 
const_reference front () const
 
containers::BoundedListInitialiser< value_type, iterator, DynamicStorageoperator<< (const Type &value)
 
containers::BoundedListInitialiser< value_type, iterator, DynamicStorageoperator<< (const Type &value)
 
void operator= (const Array< Type, DynamicStorage > &array)
 
void operator= (const Array< Type, DynamicStorage > &array)
 
reference operator[] (size_type i)
 
reference operator[] (size_type i)
 
const_reference operator[] (size_type i) const
 
const_reference operator[] (size_type i) const
 
reverse_iterator rbegin ()
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
const_reverse_iterator rend () const
 
void resize (size_t n)
 Resize the array, clearing whatever was in there before. More...
 
void resize (size_t n)
 Resize the array, clearing whatever was in there before. More...
 
size_type size () const
 The size of the array. More...
 
size_type size () const
 The size of the array. More...
 
Stencil< Array< Type, DynamicStorage > > stencil (const unsigned int &start_index, const unsigned int &n)
 Open a window (stencil) onto the array. More...
 
Stencil< Array< Type, DynamicStorage > > stencil (const unsigned int &start_index, const unsigned int &n)
 Open a window (stencil) onto the array. More...
 
 ~Array ()
 Default destructor. More...
 
 ~Array ()
 Default destructor. More...
 
- Public Member Functions inherited from ecl::BluePrintFactory< Array< Type, DynamicStorage > >
virtual ~BluePrintFactory ()
 
virtual ~BluePrintFactory ()
 

Public Attributes

const typedef Type * const_iterator
 
const typedef Type & const_reference
 

Private Member Functions

void initialiseMagicSections ()
 Prepares the array for overrun and underrun detection. More...
 

Static Private Member Functions

static const unsigned int & bufferOverrunLength ()
 
static const unsigned int & bufferUnderrunLength ()
 
static const char & magicChar ()
 

Private Attributes

Type * buffer
 
unsigned int buffer_size
 
char * overrun
 
char * underrun
 

Friends

template<typename OutputStream , typename ElementType >
OutputStream & operator<< (OutputStream &ostream, const Array< ElementType, DynamicStorage > &array)
 
template<typename OutputStream , typename ElementType >
OutputStream & operator<< (OutputStream &ostream, const Array< ElementType, DynamicStorage > &array)
 

Additional Inherited Members

- Static Public Member Functions inherited from ecl::BluePrintFactory< Array< Type, DynamicStorage > >
static blueprints::ConstantDynamicArray< Type > Constant (size_t size, const Type &value)
 Generates a constant array of the specified size. More...
 
static blueprints::ConstantDynamicArray< Type > Constant (size_t size, const Type &value)
 Generates a constant array of the specified size. More...
 

Detailed Description

template<typename Type>
class ecl::Array< Type, DynamicStorage >

Dynamic size container with a few bells and whistles.

This is a specialisation of the fixed array class (for size = 0), but instead reserves memory dynamically at run-time (on the heap, not the stack). Consequently, it is more convenient, but slower than the fixed size array class.

Comparisons:

This class doesn't do resizing on the fly like the stl vector does. It could be argued that this makes it less convenient, but the control programmer should be manually managing the resizing of the vector anyway (without doing this behaviour will be slower and more unpredictable). So this is not really a disadvantage.

On the plus side, like the fixed size array, it utilises the comma initialiser.

Usage:

This initialises like the fixed size array, but without the size template parameter. Instead, size is managed either through a constructor argument or via one of the storage commands.

Array<int,4> array; // At this point it is uninitialised.
array << 1,2,3,4; // If NDEBUG is not defined, this will throw if you exceed the range.

Every other facility that is available with fixed size arrays is also available with this class.

Error Handling

Arrays will throw exceptions whenever an operation performs an out of range operation. For most operations, this will only occur in debug mode, so release mode will run at full speed. The only exception to this is the accessor function, which provides a handle that will always throw if safety is always required.

int i = array[2]; // If NDEBUG is not defined, this will throw if you exceed the range.
int i = array.at(2); // This will always throw if you exceed the range.
Template Parameters
Type: the type of the element stored in the array.
See also
Array.

Definition at line 134 of file array_dynamic_mem_check.hpp.

Member Typedef Documentation

◆ const_reverse_iterator [1/2]

template<typename Type >
typedef std::reverse_iterator<const_iterator> ecl::Array< Type, DynamicStorage >::const_reverse_iterator

Array's constant reverse iterator type.

Definition at line 149 of file array_dynamic_mem_check.hpp.

◆ const_reverse_iterator [2/2]

template<typename Type >
typedef std::reverse_iterator<const_iterator> ecl::Array< Type, DynamicStorage >::const_reverse_iterator

Array's constant reverse iterator type.

Definition at line 150 of file array_dynamic_no_mem_check.hpp.

◆ difference_type [1/2]

template<typename Type >
typedef std::ptrdiff_t ecl::Array< Type, DynamicStorage >::difference_type

Definition at line 147 of file array_dynamic_mem_check.hpp.

◆ difference_type [2/2]

template<typename Type >
typedef std::ptrdiff_t ecl::Array< Type, DynamicStorage >::difference_type

Definition at line 148 of file array_dynamic_no_mem_check.hpp.

◆ Factory [1/2]

template<typename Type >
typedef BluePrintFactory< Array<Type,DynamicStorage> > ecl::Array< Type, DynamicStorage >::Factory

Generates blueprints for this class.

Definition at line 153 of file array_dynamic_mem_check.hpp.

◆ Factory [2/2]

template<typename Type >
typedef BluePrintFactory< Array<Type,DynamicStorage> > ecl::Array< Type, DynamicStorage >::Factory

Generates blueprints for this class.

Definition at line 154 of file array_dynamic_no_mem_check.hpp.

◆ Formatter [1/2]

template<typename Type >
typedef formatters::ArrayFormatter<Type,DynamicStorage> ecl::Array< Type, DynamicStorage >::Formatter

Formatter for this class.

Definition at line 150 of file array_dynamic_mem_check.hpp.

◆ Formatter [2/2]

template<typename Type >
typedef formatters::ArrayFormatter<Type,DynamicStorage> ecl::Array< Type, DynamicStorage >::Formatter

Formatter for this class.

Definition at line 151 of file array_dynamic_no_mem_check.hpp.

◆ iterator [1/2]

template<typename Type >
typedef Type* ecl::Array< Type, DynamicStorage >::iterator

Array's iterator type.

Definition at line 142 of file array_dynamic_mem_check.hpp.

◆ iterator [2/2]

template<typename Type >
typedef Type* ecl::Array< Type, DynamicStorage >::iterator

Array's iterator type.

Definition at line 143 of file array_dynamic_no_mem_check.hpp.

◆ reference [1/2]

template<typename Type >
typedef Type& ecl::Array< Type, DynamicStorage >::reference

Array's element reference type.

Definition at line 144 of file array_dynamic_mem_check.hpp.

◆ reference [2/2]

template<typename Type >
typedef Type& ecl::Array< Type, DynamicStorage >::reference

Array's element reference type.

Definition at line 145 of file array_dynamic_no_mem_check.hpp.

◆ reverse_iterator [1/2]

template<typename Type >
typedef std::reverse_iterator<iterator> ecl::Array< Type, DynamicStorage >::reverse_iterator

Array's reverse iterator type.

Definition at line 148 of file array_dynamic_mem_check.hpp.

◆ reverse_iterator [2/2]

template<typename Type >
typedef std::reverse_iterator<iterator> ecl::Array< Type, DynamicStorage >::reverse_iterator

Array's reverse iterator type.

Definition at line 149 of file array_dynamic_no_mem_check.hpp.

◆ size_type [1/2]

template<typename Type >
typedef std::size_t ecl::Array< Type, DynamicStorage >::size_type

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

Definition at line 146 of file array_dynamic_mem_check.hpp.

◆ size_type [2/2]

template<typename Type >
typedef std::size_t ecl::Array< Type, DynamicStorage >::size_type

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

Definition at line 147 of file array_dynamic_no_mem_check.hpp.

◆ value_type [1/2]

template<typename Type >
typedef Type ecl::Array< Type, DynamicStorage >::value_type

Array's element type.

Definition at line 141 of file array_dynamic_mem_check.hpp.

◆ value_type [2/2]

template<typename Type >
typedef Type ecl::Array< Type, DynamicStorage >::value_type

Array's element type.

Definition at line 142 of file array_dynamic_no_mem_check.hpp.

Constructor & Destructor Documentation

◆ Array() [1/8]

template<typename Type >
ecl::Array< Type, DynamicStorage >::Array ( )
inlineexplicit

Default constructor.

Does not reserve any storage for the array. Just creates the container object.

Definition at line 163 of file array_dynamic_mem_check.hpp.

◆ Array() [2/8]

template<typename Type >
ecl::Array< Type, DynamicStorage >::Array ( const unsigned int  reserve_size)
inlineexplicit

Reserves storage for the array.

This simply creates a buffer of the requested size on the heap. The values are left uninitialised.

Parameters
reserve_size: the number of elements to be allocated to the container.

Definition at line 172 of file array_dynamic_mem_check.hpp.

◆ Array() [3/8]

template<typename Type >
ecl::Array< Type, DynamicStorage >::Array ( const Array< Type, DynamicStorage > &  array)
inline

Copy constructor.

This accepts another dynamic array and uses the stl to copy over the contents.

Parameters
array: the array to copy from.

Definition at line 195 of file array_dynamic_mem_check.hpp.

◆ Array() [4/8]

template<typename Type >
template<typename T >
ecl::Array< Type, DynamicStorage >::Array ( const blueprints::ArrayBluePrint< T > &  blueprint)
inline

Blueprint constructor.

Constructor that allows automatic generation from an existing blueprint. This can be used simply in the following manner for any static element belonging to the BluePrintFactory.

Array<int> array = Array<int>::Constant(3,4);

Since this is not explicit, it will also allow assignment.

Array<int> array;
array = Array<int>::Constant(3,4);

This will emit a compile time failure if the template argument does not conform to the blueprint concept (refer to ecl_concepts documentation).

Parameters
blueprint: the blue print to use to generate this instance.

Definition at line 222 of file array_dynamic_mem_check.hpp.

◆ ~Array() [1/2]

template<typename Type >
ecl::Array< Type, DynamicStorage >::~Array ( )
inline

Default destructor.

It cleans up the memory that was used on the heap.

Definition at line 236 of file array_dynamic_mem_check.hpp.

◆ Array() [5/8]

template<typename Type >
ecl::Array< Type, DynamicStorage >::Array ( )
inlineexplicit

Default constructor.

Does not reserve any storage for the array. Just creates the container object.

Definition at line 164 of file array_dynamic_no_mem_check.hpp.

◆ Array() [6/8]

template<typename Type >
ecl::Array< Type, DynamicStorage >::Array ( const unsigned int  reserve_size)
inlineexplicit

Reserves storage for the array.

This simply creates a buffer of the requested size on the heap. The values are left uninitialised.

Parameters
reserve_size: the number of elements to be allocated to the container.

Definition at line 173 of file array_dynamic_no_mem_check.hpp.

◆ Array() [7/8]

template<typename Type >
ecl::Array< Type, DynamicStorage >::Array ( const Array< Type, DynamicStorage > &  array)
inline

Copy constructor.

This accepts another dynamic array and uses the stl to copy over the contents.

Parameters
array: the array to copy from.

Definition at line 183 of file array_dynamic_no_mem_check.hpp.

◆ Array() [8/8]

template<typename Type >
template<typename T >
ecl::Array< Type, DynamicStorage >::Array ( const blueprints::ArrayBluePrint< T > &  blueprint)
inline

Blueprint constructor.

Constructor that allows automatic generation from an existing blueprint. This can be used simply in the following manner for any static element belonging to the BluePrintFactory.

Array<int> array = Array<int>::Constant(3,4);

Since this is not explicit, it will also allow assignment.

Array<int> array;
array = Array<int>::Constant(3,4);

This will emit a compile time failure if the template argument does not conform to the blueprint concept (refer to ecl_concepts documentation).

Parameters
blueprint: the blue print to use to generate this instance.

Definition at line 214 of file array_dynamic_no_mem_check.hpp.

◆ ~Array() [2/2]

template<typename Type >
ecl::Array< Type, DynamicStorage >::~Array ( )
inline

Default destructor.

It cleans up the memory that was used on the heap.

Definition at line 227 of file array_dynamic_no_mem_check.hpp.

Member Function Documentation

◆ at() [1/4]

template<typename Type >
reference ecl::Array< Type, DynamicStorage >::at ( size_type  i)
inline

Accesses elements in the array, 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 446 of file array_dynamic_no_mem_check.hpp.

◆ at() [2/4]

template<typename Type >
reference ecl::Array< Type, DynamicStorage >::at ( size_type  i)
inline

Accesses elements in the array, 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 459 of file array_dynamic_mem_check.hpp.

◆ at() [3/4]

template<typename Type >
const_reference ecl::Array< Type, DynamicStorage >::at ( size_type  i) const
inline

Accesses elements in the array, 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 464 of file array_dynamic_no_mem_check.hpp.

◆ at() [4/4]

template<typename Type >
const_reference ecl::Array< Type, DynamicStorage >::at ( size_type  i) const
inline

Accesses elements in the array, 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 477 of file array_dynamic_mem_check.hpp.

◆ back() [1/4]

template<typename Type >
reference ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 374 of file array_dynamic_no_mem_check.hpp.

◆ back() [2/4]

template<typename Type >
reference ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 387 of file array_dynamic_mem_check.hpp.

◆ back() [3/4]

template<typename Type >
const_reference ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 384 of file array_dynamic_no_mem_check.hpp.

◆ back() [4/4]

template<typename Type >
const_reference ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 397 of file array_dynamic_mem_check.hpp.

◆ begin() [1/4]

template<typename Type >
iterator ecl::Array< Type, DynamicStorage >::begin ( )
inline

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

Returns
iterator : points to the beginning of the array.
Exceptions
StandardException: throws if no storage has been allocated [debug mode only].

Definition at line 270 of file array_dynamic_no_mem_check.hpp.

◆ begin() [2/4]

template<typename Type >
iterator ecl::Array< Type, DynamicStorage >::begin ( )
inline

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

Returns
iterator : points to the beginning of the array.
Exceptions
StandardException: throws if no storage has been allocated [debug mode only].

Definition at line 283 of file array_dynamic_mem_check.hpp.

◆ begin() [3/4]

template<typename Type >
const_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 280 of file array_dynamic_no_mem_check.hpp.

◆ begin() [4/4]

template<typename Type >
const_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 293 of file array_dynamic_mem_check.hpp.

◆ bufferOverFlow()

template<typename Type >
bool ecl::Array< Type, DynamicStorage >::bufferOverFlow

Manual handle to check for buffer under/over runs simultaneously.

This performs both under and overrun checks. If an overflow has occured, this returns the status but does not exactly specify if it was an underrun or overrun.

Returns
bool : true if a buffer overflow is detected, false otherwise.

Definition at line 644 of file array_dynamic_mem_check.hpp.

◆ bufferOverRun()

template<typename Type >
bool ecl::Array< Type, DynamicStorage >::bufferOverRun

Manual handle to check for buffer overruns.

This checks the magic chars appended to the underlying c array. If the magic chars have been modified, then this signals a warning that an under/overrun has occurred.

Returns
bool : true if a buffer overrun is detected, false otherwise.

Definition at line 622 of file array_dynamic_mem_check.hpp.

◆ bufferOverrunLength()

template<typename Type >
static const unsigned int& ecl::Array< Type, DynamicStorage >::bufferOverrunLength ( )
inlinestaticprivate

Definition at line 557 of file array_dynamic_mem_check.hpp.

◆ bufferUnderRun()

template<typename Type >
bool ecl::Array< Type, DynamicStorage >::bufferUnderRun

Manual handle to check for buffer underruns.

This checks the magic chars prepended to the underlying c array. If the magic chars have been modified, then this signals a warning that an under/overrun has occurred.

Returns
bool : true if a buffer underrun is detected, false otherwise.

Definition at line 602 of file array_dynamic_mem_check.hpp.

◆ bufferUnderrunLength()

template<typename Type >
static const unsigned int& ecl::Array< Type, DynamicStorage >::bufferUnderrunLength ( )
inlinestaticprivate

Definition at line 561 of file array_dynamic_mem_check.hpp.

◆ clear() [1/2]

template<typename Type >
void ecl::Array< Type, DynamicStorage >::clear ( )
inline

Clear the array, deleting all storage space previously allocated.

Clear the array, deleting all storage space previously allocated.

Definition at line 503 of file array_dynamic_no_mem_check.hpp.

◆ clear() [2/2]

template<typename Type >
void ecl::Array< Type, DynamicStorage >::clear ( )
inline

Clear the array, deleting all storage space previously allocated.

Clear the array, deleting all storage space previously allocated.

Definition at line 524 of file array_dynamic_mem_check.hpp.

◆ end() [1/4]

template<typename Type >
iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 290 of file array_dynamic_no_mem_check.hpp.

◆ end() [2/4]

template<typename Type >
iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 303 of file array_dynamic_mem_check.hpp.

◆ end() [3/4]

template<typename Type >
const_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 300 of file array_dynamic_no_mem_check.hpp.

◆ end() [4/4]

template<typename Type >
const_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 313 of file array_dynamic_mem_check.hpp.

◆ front() [1/4]

template<typename Type >
reference ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 354 of file array_dynamic_no_mem_check.hpp.

◆ front() [2/4]

template<typename Type >
reference ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 367 of file array_dynamic_mem_check.hpp.

◆ front() [3/4]

template<typename Type >
const_reference ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 364 of file array_dynamic_no_mem_check.hpp.

◆ front() [4/4]

template<typename Type >
const_reference ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 377 of file array_dynamic_mem_check.hpp.

◆ initialiseMagicSections()

template<typename Type >
void ecl::Array< Type, DynamicStorage >::initialiseMagicSections
private

Prepares the array for overrun and underrun detection.

Initialise the under and overrun sections with a magic char. This is later checked to see if its been disturbed.

Definition at line 583 of file array_dynamic_mem_check.hpp.

◆ magicChar()

template<typename Type >
static const char& ecl::Array< Type, DynamicStorage >::magicChar ( )
inlinestaticprivate

Definition at line 565 of file array_dynamic_mem_check.hpp.

◆ operator<<() [1/2]

template<typename Type >
containers::BoundedListInitialiser<value_type,iterator,DynamicStorage> ecl::Array< Type, DynamicStorage >::operator<< ( const Type &  value)
inline

Provides a comma initialisation facility. This initiates the comma initialiser with an iterator to the underlying array and then leaves the initialiser to do the rest. The initialiser will do range checking if NDEBUG is not defined.

Array<int> array(4); // At this point it is uninitialised.
array << 1,2,3,4; // If NDEBUG is not defined, this will throw if you exceed the range.
Parameters
value: the first value to enter , ElementType, ArraySizeinto the array.
Returns
BoundedListInitialiser : the comma initialiser mechanism.

Definition at line 248 of file array_dynamic_no_mem_check.hpp.

◆ operator<<() [2/2]

template<typename Type >
containers::BoundedListInitialiser<value_type,iterator,DynamicStorage> ecl::Array< Type, DynamicStorage >::operator<< ( const Type &  value)
inline

Provides a comma initialisation facility. This initiates the comma initialiser with an iterator to the underlying array and then leaves the initialiser to do the rest. The initialiser will do range checking if NDEBUG is not defined.

Array<int> array(4); // At this point it is uninitialised.
array << 1,2,3,4; // If NDEBUG is not defined, this will throw if you exceed the range.
Parameters
value: the first value to enter , ElementType, ArraySizeinto the array.
Returns
BoundedListInitialiser : the comma initialiser mechanism.

Definition at line 261 of file array_dynamic_mem_check.hpp.

◆ operator=() [1/2]

template<typename Type >
void ecl::Array< Type, DynamicStorage >::operator= ( const Array< Type, DynamicStorage > &  array)
inline

Definition at line 252 of file array_dynamic_no_mem_check.hpp.

◆ operator=() [2/2]

template<typename Type >
void ecl::Array< Type, DynamicStorage >::operator= ( const Array< Type, DynamicStorage > &  array)
inline

Definition at line 265 of file array_dynamic_mem_check.hpp.

◆ operator[]() [1/4]

template<typename Type >
reference ecl::Array< Type, DynamicStorage >::operator[] ( size_type  i)
inline

Accesses elements in the array, 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 417 of file array_dynamic_no_mem_check.hpp.

◆ operator[]() [2/4]

template<typename Type >
reference ecl::Array< Type, DynamicStorage >::operator[] ( size_type  i)
inline

Accesses elements in the array, 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 430 of file array_dynamic_mem_check.hpp.

◆ operator[]() [3/4]

template<typename Type >
const_reference ecl::Array< Type, DynamicStorage >::operator[] ( size_type  i) const
inline

Accesses elements in the array, 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 432 of file array_dynamic_no_mem_check.hpp.

◆ operator[]() [4/4]

template<typename Type >
const_reference ecl::Array< Type, DynamicStorage >::operator[] ( size_type  i) const
inline

Accesses elements in the array, 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 445 of file array_dynamic_mem_check.hpp.

◆ rbegin() [1/4]

template<typename Type >
reverse_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 310 of file array_dynamic_no_mem_check.hpp.

◆ rbegin() [2/4]

template<typename Type >
reverse_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 323 of file array_dynamic_mem_check.hpp.

◆ rbegin() [3/4]

template<typename Type >
const_reverse_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 320 of file array_dynamic_no_mem_check.hpp.

◆ rbegin() [4/4]

template<typename Type >
const_reverse_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 333 of file array_dynamic_mem_check.hpp.

◆ rend() [1/4]

template<typename Type >
reverse_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 330 of file array_dynamic_no_mem_check.hpp.

◆ rend() [2/4]

template<typename Type >
reverse_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 343 of file array_dynamic_mem_check.hpp.

◆ rend() [3/4]

template<typename Type >
const_reverse_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 340 of file array_dynamic_no_mem_check.hpp.

◆ rend() [4/4]

template<typename Type >
const_reverse_iterator ecl::Array< Type, DynamicStorage >::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 no storage has been allocated [debug mode only].

Definition at line 353 of file array_dynamic_mem_check.hpp.

◆ resize() [1/2]

template<typename Type >
void ecl::Array< Type, DynamicStorage >::resize ( size_t  n)
inline

Resize the array, clearing whatever was in there before.

This resizes the array. Take care with this as it will clear whatever was previously stored in the buffer. All values are uninitialised after clearing.

Parameters
n: the new size to be allocated for the array.

Definition at line 491 of file array_dynamic_no_mem_check.hpp.

◆ resize() [2/2]

template<typename Type >
void ecl::Array< Type, DynamicStorage >::resize ( size_t  n)
inline

Resize the array, clearing whatever was in there before.

This resizes the array. Take care with this as it will clear whatever was previously stored in the buffer. All values are uninitialised after clearing.

Parameters
n: the new size to be allocated for the array.

Definition at line 504 of file array_dynamic_mem_check.hpp.

◆ size() [1/2]

template<typename Type >
size_type ecl::Array< Type, DynamicStorage >::size ( ) const
inline

The size of the array.

Returns the current (dynamic) size of the array.

Returns
size_type : the size of the array.

Definition at line 481 of file array_dynamic_no_mem_check.hpp.

◆ size() [2/2]

template<typename Type >
size_type ecl::Array< Type, DynamicStorage >::size ( ) const
inline

The size of the array.

Returns the current (dynamic) size of the array.

Returns
size_type : the size of the array.

Definition at line 494 of file array_dynamic_mem_check.hpp.

◆ stencil() [1/2]

template<typename Type >
Stencil< Array<Type,DynamicStorage> > ecl::Array< Type, DynamicStorage >::stencil ( const unsigned int &  start_index,
const unsigned int &  n 
)
inline

Open a window (stencil) onto the array.

Opens a window onto the array, providing a similar container-like class to manipulate.

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

Definition at line 403 of file array_dynamic_no_mem_check.hpp.

◆ stencil() [2/2]

template<typename Type >
Stencil< Array<Type,DynamicStorage> > ecl::Array< Type, DynamicStorage >::stencil ( const unsigned int &  start_index,
const unsigned int &  n 
)
inline

Open a window (stencil) onto the array.

Opens a window onto the array, providing a similar container-like class to manipulate.

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

Definition at line 416 of file array_dynamic_mem_check.hpp.

Friends And Related Function Documentation

◆ operator<< [1/2]

template<typename Type >
template<typename OutputStream , typename ElementType >
OutputStream& operator<< ( OutputStream &  ostream,
const Array< ElementType, DynamicStorage > &  array 
)
friend

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

Parameters
ostream: the output stream.
array: the array to be inserted.
Returns
OutputStream : continue streaming with the updated output stream.

Definition at line 654 of file array_dynamic_mem_check.hpp.

◆ operator<< [2/2]

template<typename Type >
template<typename OutputStream , typename ElementType >
OutputStream& operator<< ( OutputStream &  ostream,
const Array< ElementType, DynamicStorage > &  array 
)
friend

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

Parameters
ostream: the output stream.
array: the array to be inserted.
Returns
OutputStream : continue streaming with the updated output stream.

Definition at line 654 of file array_dynamic_mem_check.hpp.

Member Data Documentation

◆ buffer

template<typename Type >
Type * ecl::Array< Type, DynamicStorage >::buffer
private

Definition at line 571 of file array_dynamic_mem_check.hpp.

◆ buffer_size

template<typename Type >
unsigned int ecl::Array< Type, DynamicStorage >::buffer_size
private

Definition at line 569 of file array_dynamic_mem_check.hpp.

◆ const_iterator

template<typename Type >
const typedef Type * ecl::Array< Type, DynamicStorage >::const_iterator

Array's constant iterator type.

Definition at line 143 of file array_dynamic_mem_check.hpp.

◆ const_reference

template<typename Type >
const typedef Type & ecl::Array< Type, DynamicStorage >::const_reference

Array's element const reference type.

Definition at line 145 of file array_dynamic_mem_check.hpp.

◆ overrun

template<typename Type >
char* ecl::Array< Type, DynamicStorage >::overrun
private

Definition at line 572 of file array_dynamic_mem_check.hpp.

◆ underrun

template<typename Type >
char* ecl::Array< Type, DynamicStorage >::underrun
private

Definition at line 570 of file array_dynamic_mem_check.hpp.


The documentation for this class was generated from the following files:
ecl::blueprints::ArrayFactory< Type, DynamicStorage >::Constant
static ConstantArray< Type, Size > Constant(const Type &value)
Definition: array_no_mem_check.hpp:529


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