Public Types | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
openfluid::core::Vector< T > Class Template Reference

#include <core/Vector.hpp>

Collaboration diagram for openfluid::core::Vector< T >:
Collaboration graph
[legend]

Public Types

typedef T * iterator
 
typedef const T * const_iterator
 

Public Member Functions

 Vector ()
 
 Vector (const Vector &Vector)
 
 Vector (unsigned long Size)
 
 Vector (unsigned long Size, T InitValue)
 
 Vector (T *Data, unsigned long Size)
 
 ~Vector ()
 
unsigned long getSize () const
 
unsigned long size () const
 
T * data () const
 
void setData (T *Data, unsigned long Size)
 
getElement (unsigned long Index) const
 
at (unsigned long Index) const
 
get (unsigned long Index) const
 
void setElement (unsigned long Index, T Element)
 
void set (unsigned long Index, T Element)
 
T & operator[] (unsigned long Index)
 
Vector< T > & operator= (const Vector &A)
 
void fill (const T &Val)
 
void clear ()
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 

Protected Member Functions

bool allocate (unsigned long Size)
 
void init ()
 

Static Protected Member Functions

static void copy (const Vector &Source, Vector &Dest)
 

Protected Attributes

T * m_Data
 
unsigned long m_Size
 

Detailed Description

template<class T>
class openfluid::core::Vector< T >

Template class for vector data

Member Typedef Documentation

template<class T>
typedef const T* openfluid::core::Vector< T >::const_iterator
template<class T>
typedef T* openfluid::core::Vector< T >::iterator

Constructor & Destructor Documentation

template<class T >
openfluid::core::Vector< T >::Vector ( )

Default constructor, creates an empty vector

template<class T >
openfluid::core::Vector< T >::Vector ( const Vector< T > &  Vector)

Copy constructor

template<class T >
openfluid::core::Vector< T >::Vector ( unsigned long  Size)

Constructor, creates a vector containing Size elements

template<class T>
openfluid::core::Vector< T >::Vector ( unsigned long  Size,
InitValue 
)

Constructor, creates a vector containing Size elements, initialized with value InitValue

template<class T>
openfluid::core::Vector< T >::Vector ( T *  Data,
unsigned long  Size 
)

Constructor, creates a vector of size Size, containing Data

template<class T >
openfluid::core::Vector< T >::~Vector ( )

Destructor

Member Function Documentation

template<class T >
bool openfluid::core::Vector< T >::allocate ( unsigned long  Size)
protected
template<class T>
T openfluid::core::Vector< T >::at ( unsigned long  Index) const
inline

Returns the element of the vector for index Index

template<class T>
iterator openfluid::core::Vector< T >::begin ( )
inline

Returns an iterator referring to the first element in the vector

Returns
an iterator to the first element in the vector
template<class T>
const_iterator openfluid::core::Vector< T >::begin ( ) const
inline

Returns a constant iterator referring to the first element in the vector

Returns
a constant iterator to the first element in the vector
template<class T >
void openfluid::core::Vector< T >::clear ( )

Clears the vector (empty and size is 0)

template<class T >
void openfluid::core::Vector< T >::copy ( const Vector< T > &  Source,
Vector< T > &  Dest 
)
staticprotected
template<class T>
T* openfluid::core::Vector< T >::data ( ) const
inline

Returns a pointer to the content of the vector (like C arrays)

template<class T>
iterator openfluid::core::Vector< T >::end ( )
inline

Returns an iterator referring to the past-the-end element in the vector

Returns
an iterator to the past-the-end element in the vector
template<class T>
const_iterator openfluid::core::Vector< T >::end ( ) const
inline

Returns a constant iterator referring to the past-the-end element in the vector

Returns
a constant iterator to the past-the-end element in the vector
template<class T>
void openfluid::core::Vector< T >::fill ( const T &  Val)

Fills the vector with given value

template<class T>
T openfluid::core::Vector< T >::get ( unsigned long  Index) const
inline

Returns the element of the vector for index Index

template<class T >
T openfluid::core::Vector< T >::getElement ( unsigned long  Index) const

Returns the element of the vector for index Index

template<class T>
unsigned long openfluid::core::Vector< T >::getSize ( ) const
inline

Returns the size of the vector

Returns
size of the vector
template<class T >
void openfluid::core::Vector< T >::init ( )
protected
template<class T >
Vector< T > & openfluid::core::Vector< T >::operator= ( const Vector< T > &  A)

Allocation operator

template<class T >
T & openfluid::core::Vector< T >::operator[] ( unsigned long  Index)

Operator to set a new value for element given between []

template<class T>
void openfluid::core::Vector< T >::set ( unsigned long  Index,
Element 
)
inline

Sets a new value for element at the given index

template<class T>
void openfluid::core::Vector< T >::setData ( T *  Data,
unsigned long  Size 
)

Sets data for the vector from Data and with size Size

template<class T>
void openfluid::core::Vector< T >::setElement ( unsigned long  Index,
Element 
)

Sets a new value for element at the given index

template<class T>
unsigned long openfluid::core::Vector< T >::size ( ) const
inline

Returns the size of the vector

Returns
size of the vector

Member Data Documentation

template<class T>
T* openfluid::core::Vector< T >::m_Data
protected
template<class T>
unsigned long openfluid::core::Vector< T >::m_Size
protected

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