Public Member Functions | Protected Attributes | List of all members
ecl::containers::BoundedListInitialiser< Type, Iterator, DynamicStorage > Class Template Reference

Convenience initialiser with bounds checking for dynamic containers. More...

#include <initialiser.hpp>

Public Member Functions

 BoundedListInitialiser (const Type &value, Iterator iter, std::size_t bound)
 
BoundedListInitialiser< Type, Iterator, DynamicStorage > & operator, (const Type &value)
 
virtual ~BoundedListInitialiser ()
 

Protected Attributes

std::size_t current_size
 
Iterator iterator
 
const std::size_t upper_bound
 

Detailed Description

template<class Type, class Iterator>
class ecl::containers::BoundedListInitialiser< Type, Iterator, DynamicStorage >

Convenience initialiser with bounds checking for dynamic containers.

Initialises containers in a manner similar to that used in Blitz++ and Eigen2 with a comma separated list. It also does range checking in debug mode. The containers are assumed to have dynamic storage length retrievable from the container class itself.

This is a specialisation of the fixed container bounded list initialiser.

See also
BoundedClassInitialiser

Definition at line 129 of file initialiser.hpp.

Constructor & Destructor Documentation

◆ BoundedListInitialiser()

template<typename Type , typename Iterator >
ecl::containers::BoundedListInitialiser< Type, Iterator, DynamicStorage >::BoundedListInitialiser ( const Type &  value,
Iterator  iter,
std::size_t  bound 
)

Gets a handle to an iterator of the underlying container and adds the first value.

Parameters
value: first element to be added to the initialiser.
iter: a pointer to the current element to be added to the container.
bound: size of the container it is initialising.
Exceptions
StandardException: throws if this container has no storage capacity [debug mode only].

Definition at line 167 of file initialiser.hpp.

◆ ~BoundedListInitialiser()

template<class Type , class Iterator >
virtual ecl::containers::BoundedListInitialiser< Type, Iterator, DynamicStorage >::~BoundedListInitialiser ( )
inlinevirtual

Definition at line 145 of file initialiser.hpp.

Member Function Documentation

◆ operator,()

template<typename Type , typename Iterator >
BoundedListInitialiser< Type, Iterator, DynamicStorage > & ecl::containers::BoundedListInitialiser< Type, Iterator, DynamicStorage >::operator, ( const Type &  value)

Convenience operator for initialising container types with a comma separated list. It uses a current BoundedListInitialiser instance to add the next value to the underlying class and returns the same instance with incremented iterator.

Parameters
value: the value to be inserted at the location of the stored iterator.
Returns
BoundedListInitialiser : the initialiser class.
Exceptions
StandardException: throws if the range has been exceeded [debug mode only].

Definition at line 177 of file initialiser.hpp.

Member Data Documentation

◆ current_size

template<class Type , class Iterator >
std::size_t ecl::containers::BoundedListInitialiser< Type, Iterator, DynamicStorage >::current_size
protected

Definition at line 160 of file initialiser.hpp.

◆ iterator

template<class Type , class Iterator >
Iterator ecl::containers::BoundedListInitialiser< Type, Iterator, DynamicStorage >::iterator
protected

Definition at line 159 of file initialiser.hpp.

◆ upper_bound

template<class Type , class Iterator >
const std::size_t ecl::containers::BoundedListInitialiser< Type, Iterator, DynamicStorage >::upper_bound
protected

Definition at line 161 of file initialiser.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