Public Types | Public Member Functions | Private Member Functions | List of all members
oomph::Vector< _Tp > Class Template Reference

#include <Vector.h>

+ Inheritance diagram for oomph::Vector< _Tp >:

Public Types

typedef _Tp value_type
 Typedef to make the constructors look a bit cleaner. More...
 
typedef value_typereference
 Typedef to make the constructors look a bit cleaner. More...
 
typedef const value_typeconst_reference
 Typedef to make the constructors look a bit cleaner. More...
 
typedef size_t size_type
 Typedef to make the constructors look a bit cleaner. More...
 

Public Member Functions

 Vector ()
 Construct an empty vector. More...
 
 Vector (size_type __n)
 A constructor that creates a vector of size __n. Note the use of explicit for "strong" type checking. More...
 
 Vector (size_type __n, const _Tp &__value)
 A constructor that creates a vector of size __n and initialises every entry to __value. More...
 
 Vector (const Vector< _Tp > &__x)
 Copy constructor. More...
 
void initialise (const _Tp &__value)
 Iterate over all values and set to the desired value. More...
 
reference operator[] (size_type __n)
 
const_reference operator[] (size_type __n) const
 Overloaded, range-checking, bracket access operator (const version) More...
 

Private Member Functions

reference error_checked_access (size_type __n)
 
const_reference error_checked_access (size_type __n) const
 

Detailed Description

template<class _Tp>
class oomph::Vector< _Tp >

A slight extension to the standard template vector class so that we can include "graceful" array range checks if the RANGE_CHECKING flag is set. The generalisation to general allocators is NOT handled here, mainly because we never use it, but also because the intel and gnu compilers have different names for the internal classes, which makes writing code that works for both a pain!

Definition at line 63 of file Vector.h.

Member Typedef Documentation

template<class _Tp>
typedef const value_type& oomph::Vector< _Tp >::const_reference

Typedef to make the constructors look a bit cleaner.

Definition at line 75 of file Vector.h.

template<class _Tp>
typedef value_type& oomph::Vector< _Tp >::reference

Typedef to make the constructors look a bit cleaner.

Definition at line 72 of file Vector.h.

template<class _Tp>
typedef size_t oomph::Vector< _Tp >::size_type

Typedef to make the constructors look a bit cleaner.

Definition at line 78 of file Vector.h.

template<class _Tp>
typedef _Tp oomph::Vector< _Tp >::value_type

Typedef to make the constructors look a bit cleaner.

Definition at line 69 of file Vector.h.

Constructor & Destructor Documentation

template<class _Tp>
oomph::Vector< _Tp >::Vector ( )
inline

Construct an empty vector.

Definition at line 153 of file Vector.h.

template<class _Tp>
oomph::Vector< _Tp >::Vector ( size_type  __n)
inlineexplicit

A constructor that creates a vector of size __n. Note the use of explicit for "strong" type checking.

Definition at line 157 of file Vector.h.

template<class _Tp>
oomph::Vector< _Tp >::Vector ( size_type  __n,
const _Tp &  __value 
)
inline

A constructor that creates a vector of size __n and initialises every entry to __value.

Definition at line 161 of file Vector.h.

template<class _Tp>
oomph::Vector< _Tp >::Vector ( const Vector< _Tp > &  __x)
inline

Copy constructor.

Definition at line 164 of file Vector.h.

Member Function Documentation

template<class _Tp>
reference oomph::Vector< _Tp >::error_checked_access ( size_type  __n)
inlineprivate

Definition at line 86 of file Vector.h.

Referenced by oomph::Vector< oomph::Vector< unsigned > >::operator[]().

template<class _Tp>
const_reference oomph::Vector< _Tp >::error_checked_access ( size_type  __n) const
inlineprivate

Definition at line 121 of file Vector.h.

template<class _Tp>
void oomph::Vector< _Tp >::initialise ( const _Tp &  __value)
inline
template<class _Tp>
reference oomph::Vector< _Tp >::operator[] ( size_type  __n)
inline

Overload the bracket access operator to include array-range checking if the RANGE_CHECKING flag is set

Definition at line 183 of file Vector.h.

template<class _Tp>
const_reference oomph::Vector< _Tp >::operator[] ( size_type  __n) const
inline

Overloaded, range-checking, bracket access operator (const version)

Definition at line 189 of file Vector.h.


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