![]() |
#include <core/Vector.hpp>
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) |
T | getElement (unsigned long Index) const |
T | at (unsigned long Index) const |
T | 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 |
Template class for vector data
typedef const T* openfluid::core::Vector< T >::const_iterator |
typedef T* openfluid::core::Vector< T >::iterator |
openfluid::core::Vector< T >::Vector | ( | ) |
Default constructor, creates an empty vector
openfluid::core::Vector< T >::Vector | ( | const Vector< T > & | Vector | ) |
Copy constructor
openfluid::core::Vector< T >::Vector | ( | unsigned long | Size | ) |
Constructor, creates a vector containing Size elements
openfluid::core::Vector< T >::Vector | ( | unsigned long | Size, |
T | InitValue | ||
) |
Constructor, creates a vector containing Size elements, initialized with value InitValue
openfluid::core::Vector< T >::Vector | ( | T * | Data, |
unsigned long | Size | ||
) |
Constructor, creates a vector of size Size, containing Data
openfluid::core::Vector< T >::~Vector | ( | ) |
Destructor
|
protected |
|
inline |
Returns the element of the vector for index Index
|
inline |
Returns an iterator referring to the first element in the vector
|
inline |
Returns a constant iterator referring to the first element in the vector
void openfluid::core::Vector< T >::clear | ( | ) |
Clears the vector (empty and size is 0)
|
staticprotected |
|
inline |
Returns a pointer to the content of the vector (like C arrays)
|
inline |
Returns an iterator referring to the past-the-end element in the vector
|
inline |
Returns a constant iterator referring to the past-the-end element in the vector
void openfluid::core::Vector< T >::fill | ( | const T & | Val | ) |
Fills the vector with given value
|
inline |
Returns the element of the vector for index Index
T openfluid::core::Vector< T >::getElement | ( | unsigned long | Index | ) | const |
Returns the element of the vector for index Index
|
inline |
Returns the size of the vector
|
protected |
Vector< T > & openfluid::core::Vector< T >::operator= | ( | const Vector< T > & | A | ) |
Allocation operator
T & openfluid::core::Vector< T >::operator[] | ( | unsigned long | Index | ) |
Operator to set a new value for element given between []
|
inline |
Sets a new value for element at the given index
void openfluid::core::Vector< T >::setData | ( | T * | Data, |
unsigned long | Size | ||
) |
Sets data for the vector from Data and with size Size
void openfluid::core::Vector< T >::setElement | ( | unsigned long | Index, |
T | Element | ||
) |
Sets a new value for element at the given index
|
inline |
Returns the size of the vector
|
protected |
|
protected |