Public Types | Public Member Functions | Protected Attributes | List of all members
Seldon::Vector_Base< T, Allocator > Class Template Reference

Base structure for all vectors. More...

#include <Vector.hxx>

Inheritance diagram for Seldon::Vector_Base< T, Allocator >:
Seldon::PETScVector< T, Allocator > Seldon::Vector< T, Collection, Allocator > Seldon::Vector< T, VectFull, Allocator > Seldon::Vector< T, PETScPar, Allocator > Seldon::Vector< T, PETScSeq, Allocator > Seldon::Vector< T, VectSparse, Allocator >

Public Types

typedef Allocator::value_type value_type
 
typedef Allocator::pointer pointer
 
typedef Allocator::const_pointer const_pointer
 
typedef Allocator::reference reference
 
typedef Allocator::const_reference const_reference
 
typedef Allocator allocator
 

Public Member Functions

 Vector_Base ()
 Default constructor. More...
 
 Vector_Base (size_t i)
 Main constructor. More...
 
 Vector_Base (const Vector_Base< T, Allocator > &A)
 Copy constructor. More...
 
 ~Vector_Base ()
 Destructor.
 
void Clear ()
 Releases memory used by the vector.
 
long GetM () const
 Returns the number of elements. More...
 
size_t GetLength () const
 Returns the number of elements. More...
 
size_t GetSize () const
 Returns the number of elements stored. More...
 
size_t GetMemorySize () const
 Returns the memory used by the object in bytes. More...
 
pointer GetData () const
 Returns a pointer to data_ (stored data). More...
 
const_pointer GetDataConst () const
 Returns a const pointer to data_ (stored data). More...
 
void * GetDataVoid () const
 Returns a pointer of type "void*" to the data array (data_). More...
 
const void * GetDataConstVoid () const
 Returns a pointer of type "const void*" to the data array (data_). More...
 

Protected Attributes

size_t m_
 
pointer data_
 

Detailed Description

template<class T, class Allocator = typename SeldonDefaultAllocator<VectFull, T>::allocator>
class Seldon::Vector_Base< T, Allocator >

Base structure for all vectors.

It stores data and the vector size. It defines basic methods as well.

Definition at line 201 of file SeldonHeader.hxx.

Constructor & Destructor Documentation

◆ Vector_Base() [1/3]

template<class T , class Allocator >
Seldon::Vector_Base< T, Allocator >::Vector_Base
inline

Default constructor.

Nothing is allocated. Vector length is set to zero.

Definition at line 45 of file VectorInline.cxx.

◆ Vector_Base() [2/3]

template<class T , class Allocator >
Seldon::Vector_Base< T, Allocator >::Vector_Base ( size_t  i)
inlineexplicit

Main constructor.

Parameters
ilength.
Warning
Nothing is allocated.

Definition at line 58 of file VectorInline.cxx.

◆ Vector_Base() [3/3]

template<class T , class Allocator >
Seldon::Vector_Base< T, Allocator >::Vector_Base ( const Vector_Base< T, Allocator > &  A)
inline

Copy constructor.

Parameters
Abase vector to be copied.
Warning
Only the length is copied.

Definition at line 72 of file VectorInline.cxx.

Member Function Documentation

◆ GetData()

template<class T , class Allocator >
Vector_Base< T, Allocator >::pointer Seldon::Vector_Base< T, Allocator >::GetData
inline

Returns a pointer to data_ (stored data).

Returns
A pointer to the data_, i.e. the data array.

Definition at line 177 of file VectorInline.cxx.

◆ GetDataConst()

template<class T , class Allocator >
Vector_Base< T, Allocator >::const_pointer Seldon::Vector_Base< T, Allocator >::GetDataConst
inline

Returns a const pointer to data_ (stored data).

Returns
A const pointer to the data_, i.e. the data array.

Definition at line 189 of file VectorInline.cxx.

◆ GetDataConstVoid()

template<class T , class Allocator >
const void * Seldon::Vector_Base< T, Allocator >::GetDataConstVoid
inline

Returns a pointer of type "const void*" to the data array (data_).

Returns
A pointer of type "const void*" to the data array.

Definition at line 212 of file VectorInline.cxx.

◆ GetDataVoid()

template<class T , class Allocator >
void * Seldon::Vector_Base< T, Allocator >::GetDataVoid
inline

Returns a pointer of type "void*" to the data array (data_).

Returns
A pointer of type "void*" to the data array.

Definition at line 201 of file VectorInline.cxx.

◆ GetLength()

template<class T , class Allocator >
size_t Seldon::Vector_Base< T, Allocator >::GetLength
inline

Returns the number of elements.

Returns
The length of the vector.

Definition at line 142 of file VectorInline.cxx.

◆ GetM()

template<class T , class Allocator >
long Seldon::Vector_Base< T, Allocator >::GetM
inline

Returns the number of elements.

Returns
The length of the vector.

Definition at line 131 of file VectorInline.cxx.

◆ GetMemorySize()

template<class T , class Allocator >
size_t Seldon::Vector_Base< T, Allocator >::GetMemorySize
inline

Returns the memory used by the object in bytes.

In this method, the type T is assumed to be "static" such that sizeof(T) provides the correct size

Definition at line 165 of file VectorInline.cxx.

◆ GetSize()

template<class T , class Allocator >
size_t Seldon::Vector_Base< T, Allocator >::GetSize
inline

Returns the number of elements stored.

Returns
The length of the vector stored.

Definition at line 153 of file VectorInline.cxx.


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