Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
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]

List of all members.

Public Types

typedef const Type * const_iterator
typedef const Type * const_iterator
typedef const Type & const_reference
typedef const Type & const_reference
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
typedef std::reverse_iterator
< const_iterator
const_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.
typedef BluePrintFactory
< Array< Type, DynamicStorage > > 
Factory
 Generates blueprints for this class.
typedef
formatters::ArrayFormatter
< Type, DynamicStorage > 
Formatter
 Formatter for this class.
typedef
formatters::ArrayFormatter
< Type, DynamicStorage > 
Formatter
 Formatter for this class.
typedef Type * iterator
typedef Type * iterator
typedef Type & reference
typedef Type & reference
typedef std::reverse_iterator
< iterator
reverse_iterator
typedef std::reverse_iterator
< iterator
reverse_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.
 Array ()
 Default constructor.
 Array (const unsigned int reserve_size)
 Reserves storage for the array.
 Array (const unsigned int reserve_size) ecl_assert_throw_decl(StandardException)
 Reserves storage for the array.
 Array (const Array< Type, DynamicStorage > &array)
 Copy constructor.
 Array (const Array< Type, DynamicStorage > &array)
 Copy constructor.
template<typename T >
 Array (const blueprints::ArrayBluePrint< T > &blueprint)
 Blueprint constructor.
template<typename T >
 Array (const blueprints::ArrayBluePrint< T > &blueprint)
 Blueprint constructor.
reference at (size_type i) throw (StandardException)
reference at (size_type i) throw (StandardException)
const_reference at (size_type i) const throw (StandardException)
const_reference at (size_type i) const throw (StandardException)
reference back () ecl_assert_throw_decl(StandardException)
const_reference back () const ecl_assert_throw_decl(StandardException)
reference back () ecl_assert_throw_decl(StandardException)
const_reference back () const ecl_assert_throw_decl(StandardException)
iterator begin () ecl_assert_throw_decl(StandardException)
const_iterator begin () const ecl_assert_throw_decl(StandardException)
iterator begin () ecl_assert_throw_decl(StandardException)
const_iterator begin () const ecl_assert_throw_decl(StandardException)
bool bufferOverFlow ()
 Manual handle to check for buffer under/over runs simultaneously.
bool bufferOverRun ()
 Manual handle to check for buffer overruns.
bool bufferUnderRun ()
 Manual handle to check for buffer underruns.
void clear ()
void clear ()
iterator end () ecl_assert_throw_decl(StandardException)
const_iterator end () const ecl_assert_throw_decl(StandardException)
iterator end () ecl_assert_throw_decl(StandardException)
const_iterator end () const ecl_assert_throw_decl(StandardException)
reference front () ecl_assert_throw_decl(StandardException)
const_reference front () const ecl_assert_throw_decl(StandardException)
reference front () ecl_assert_throw_decl(StandardException)
const_reference front () const ecl_assert_throw_decl(StandardException)
containers::BoundedListInitialiser
< value_type, iterator,
DynamicStorage > 
operator<< (const Type &value)
containers::BoundedListInitialiser
< value_type, iterator,
DynamicStorage > 
operator<< (const Type &value)
void operator= (const Array< Type, DynamicStorage > &array)
void operator= (const Array< Type, DynamicStorage > &array)
reference operator[] (size_type i) ecl_assert_throw_decl(StandardException)
reference operator[] (size_type i) ecl_assert_throw_decl(StandardException)
const_reference operator[] (size_type i) const ecl_assert_throw_decl(StandardException)
const_reference operator[] (size_type i) const ecl_assert_throw_decl(StandardException)
reverse_iterator rbegin () ecl_assert_throw_decl(StandardException)
const_reverse_iterator rbegin () const ecl_assert_throw_decl(StandardException)
reverse_iterator rbegin () ecl_assert_throw_decl(StandardException)
const_reverse_iterator rbegin () const ecl_assert_throw_decl(StandardException)
reverse_iterator rend () ecl_assert_throw_decl(StandardException)
const_reverse_iterator rend () const ecl_assert_throw_decl(StandardException)
reverse_iterator rend () ecl_assert_throw_decl(StandardException)
const_reverse_iterator rend () const ecl_assert_throw_decl(StandardException)
void resize (size_t n)
 Resize the array, clearing whatever was in there before.
void resize (size_t n) ecl_assert_throw_decl(StandardException)
 Resize the array, clearing whatever was in there before.
size_type size () const
 The size of the array.
size_type size () const
 The size of the array.
Stencil< Array< Type,
DynamicStorage > > 
stencil (const unsigned int &start_index, const unsigned int &n) ecl_assert_throw_decl(StandardException)
 Open a window (stencil) onto the array.
Stencil< Array< Type,
DynamicStorage > > 
stencil (const unsigned int &start_index, const unsigned int &n) ecl_assert_throw_decl(StandardException)
 Open a window (stencil) onto the array.
 ~Array ()
 Default destructor.
 ~Array () ecl_assert_throw_decl(StandardException)
 Default destructor.

Private Member Functions

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

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)

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 128 of file array_dynamic_mem_check.hpp.


Member Typedef Documentation

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

Array's constant iterator type.

Definition at line 135 of file array_dynamic_mem_check.hpp.

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

Array's constant iterator type.

Definition at line 136 of file array_dynamic_no_mem_check.hpp.

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

Array's element const reference type.

Definition at line 137 of file array_dynamic_mem_check.hpp.

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

Array's element const reference type.

Definition at line 138 of file array_dynamic_no_mem_check.hpp.

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 141 of file array_dynamic_mem_check.hpp.

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 142 of file array_dynamic_no_mem_check.hpp.

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

Definition at line 139 of file array_dynamic_mem_check.hpp.

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

Definition at line 140 of file array_dynamic_no_mem_check.hpp.

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

Generates blueprints for this class.

Definition at line 145 of file array_dynamic_mem_check.hpp.

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

Generates blueprints for this class.

Definition at line 146 of file array_dynamic_no_mem_check.hpp.

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

Formatter for this class.

Definition at line 142 of file array_dynamic_mem_check.hpp.

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

Formatter for this class.

Definition at line 143 of file array_dynamic_no_mem_check.hpp.

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

Array's iterator type.

Definition at line 134 of file array_dynamic_mem_check.hpp.

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

Array's iterator type.

Definition at line 135 of file array_dynamic_no_mem_check.hpp.

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

Array's element reference type.

Definition at line 136 of file array_dynamic_mem_check.hpp.

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

Array's element reference type.

Definition at line 137 of file array_dynamic_no_mem_check.hpp.

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

Array's reverse iterator type.

Definition at line 140 of file array_dynamic_mem_check.hpp.

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

Array's reverse iterator type.

Definition at line 141 of file array_dynamic_no_mem_check.hpp.

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 138 of file array_dynamic_mem_check.hpp.

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 139 of file array_dynamic_no_mem_check.hpp.

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

Array's element type.

Definition at line 133 of file array_dynamic_mem_check.hpp.

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

Array's element type.

Definition at line 134 of file array_dynamic_no_mem_check.hpp.


Constructor & Destructor Documentation

template<typename Type >
ecl::Array< Type, DynamicStorage >::Array ( ) [inline, explicit]

Default constructor.

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

Definition at line 155 of file array_dynamic_mem_check.hpp.

template<typename Type >
ecl::Array< Type, DynamicStorage >::Array ( const unsigned int  reserve_size) [inline, explicit]

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 164 of file array_dynamic_mem_check.hpp.

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 187 of file array_dynamic_mem_check.hpp.

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.

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_mem_check.hpp.

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 228 of file array_dynamic_mem_check.hpp.

template<typename Type >
ecl::Array< Type, DynamicStorage >::Array ( ) [inline, explicit]

Default constructor.

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

Definition at line 156 of file array_dynamic_no_mem_check.hpp.

template<typename Type >
ecl::Array< Type, DynamicStorage >::Array ( const unsigned int  reserve_size) [inline, explicit]

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 165 of file array_dynamic_no_mem_check.hpp.

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 175 of file array_dynamic_no_mem_check.hpp.

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.

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 206 of file array_dynamic_no_mem_check.hpp.

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 219 of file array_dynamic_no_mem_check.hpp.


Member Function Documentation

template<typename Type >
reference ecl::Array< Type, DynamicStorage >::at ( size_type  i) throw (StandardException) [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 438 of file array_dynamic_no_mem_check.hpp.

template<typename Type >
reference ecl::Array< Type, DynamicStorage >::at ( size_type  i) throw (StandardException) [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 451 of file array_dynamic_mem_check.hpp.

template<typename Type >
const_reference ecl::Array< Type, DynamicStorage >::at ( size_type  i) const throw (StandardException) [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 456 of file array_dynamic_no_mem_check.hpp.

template<typename Type >
const_reference ecl::Array< Type, DynamicStorage >::at ( size_type  i) const throw (StandardException) [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 469 of file array_dynamic_mem_check.hpp.

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 366 of file array_dynamic_no_mem_check.hpp.

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 376 of file array_dynamic_no_mem_check.hpp.

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 379 of file array_dynamic_mem_check.hpp.

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 389 of file array_dynamic_mem_check.hpp.

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 262 of file array_dynamic_no_mem_check.hpp.

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 272 of file array_dynamic_no_mem_check.hpp.

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 275 of file array_dynamic_mem_check.hpp.

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 285 of file array_dynamic_mem_check.hpp.

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 638 of file array_dynamic_mem_check.hpp.

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 616 of file array_dynamic_mem_check.hpp.

template<typename Type >
static const unsigned int& ecl::Array< Type, DynamicStorage >::bufferOverrunLength ( ) [inline, static, private]

Definition at line 549 of file array_dynamic_mem_check.hpp.

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 596 of file array_dynamic_mem_check.hpp.

template<typename Type >
static const unsigned int& ecl::Array< Type, DynamicStorage >::bufferUnderrunLength ( ) [inline, static, private]

Definition at line 553 of file array_dynamic_mem_check.hpp.

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

Clear the array, deleting all storage space previously allocated.

Definition at line 495 of file array_dynamic_no_mem_check.hpp.

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

Clear the array, deleting all storage space previously allocated.

Definition at line 516 of file array_dynamic_mem_check.hpp.

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 282 of file array_dynamic_no_mem_check.hpp.

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 292 of file array_dynamic_no_mem_check.hpp.

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 295 of file array_dynamic_mem_check.hpp.

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 305 of file array_dynamic_mem_check.hpp.

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 346 of file array_dynamic_no_mem_check.hpp.

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 356 of file array_dynamic_no_mem_check.hpp.

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 359 of file array_dynamic_mem_check.hpp.

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 369 of file array_dynamic_mem_check.hpp.

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 577 of file array_dynamic_mem_check.hpp.

template<typename Type >
static const char& ecl::Array< Type, DynamicStorage >::magicChar ( ) [inline, static, private]

Definition at line 557 of file array_dynamic_mem_check.hpp.

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 240 of file array_dynamic_no_mem_check.hpp.

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 253 of file array_dynamic_mem_check.hpp.

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

Definition at line 244 of file array_dynamic_no_mem_check.hpp.

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

Definition at line 257 of file array_dynamic_mem_check.hpp.

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 409 of file array_dynamic_no_mem_check.hpp.

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 422 of file array_dynamic_mem_check.hpp.

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 424 of file array_dynamic_no_mem_check.hpp.

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 437 of file array_dynamic_mem_check.hpp.

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 302 of file array_dynamic_no_mem_check.hpp.

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 312 of file array_dynamic_no_mem_check.hpp.

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 315 of file array_dynamic_mem_check.hpp.

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 325 of file array_dynamic_mem_check.hpp.

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 322 of file array_dynamic_no_mem_check.hpp.

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 332 of file array_dynamic_no_mem_check.hpp.

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 335 of file array_dynamic_mem_check.hpp.

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 345 of file array_dynamic_mem_check.hpp.

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 483 of file array_dynamic_no_mem_check.hpp.

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 496 of file array_dynamic_mem_check.hpp.

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 473 of file array_dynamic_no_mem_check.hpp.

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 486 of file array_dynamic_mem_check.hpp.

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 395 of file array_dynamic_no_mem_check.hpp.

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 408 of file array_dynamic_mem_check.hpp.


Friends And Related Function Documentation

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 648 of file array_dynamic_mem_check.hpp.

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 648 of file array_dynamic_mem_check.hpp.


Member Data Documentation

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

Definition at line 563 of file array_dynamic_mem_check.hpp.

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

Definition at line 561 of file array_dynamic_mem_check.hpp.

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

Definition at line 564 of file array_dynamic_mem_check.hpp.

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

Definition at line 562 of file array_dynamic_mem_check.hpp.


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


ecl_containers
Author(s): Daniel Stonier (d.stonier@gmail.com)
autogenerated on Thu Jan 2 2014 11:12:25