Vector class allowing to define vectors as sub parts of referred vectors.
More...
#include <Vector.hpp>
template<typename T>
class gatb::core::tools::misc::Vector< T >
Vector class allowing to define vectors as sub parts of referred vectors.
This vector implementation supports two kind of memory management:
- dynamic allocation: the data buffer is allocated
- reference : the data buffer is a reference to some existing buffer in memory
Constructor with initial size.
- Parameters
-
aSize | : initial size of the vector. |
char* getBuffer |
( |
| ) |
const |
|
inline |
- Returns
- buffer holding the actual data.
T& operator[] |
( |
size_t |
idx | ) |
|
|
inline |
Data access
- Parameters
-
[in] | idx | : index of the character to be retrieved |
- Returns
- the retrieved character.
void resize |
( |
size_t |
aSize | ) |
|
|
inline |
Resize the current vector.
- Parameters
-
[in] | aSize | : new size of the vector. |
void set |
( |
const T * |
buffer, |
|
|
size_t |
length |
|
) |
| |
|
inline |
Set the current data. Copy is done.
- Parameters
-
[in] | buffer | : data referred by the current instance. |
[in] | length | : size of the data |
void setRef |
( |
Vector< T > * |
ref, |
|
|
size_t |
offset, |
|
|
size_t |
length |
|
) |
| |
|
inline |
Set the current data as a part of a referenced another data.
- Parameters
-
[in] | ref | : data referred by the current instance. |
[in] | offset | : the current data will begin 'offset' bytes from the beginning of the referred data. |
[in] | length | : size of the data |
void setRef |
( |
T * |
buffer, |
|
|
size_t |
length |
|
) |
| |
|
inline |
Set the current data as a part of a referenced another data.
- Parameters
-
[in] | buffer | : pointer to the buffer to be referred |
[in] | length | : size of the data |
void setSize |
( |
size_t |
size | ) |
|
|
inline |
Set the size of the vector.
- Parameters
-
[in] | size | : new size of the vector. |
- Returns
- buffer size (in bytes).
The documentation for this class was generated from the following file:
- /builds/workspace/publish-doc-api-gitlab/gatb-core/src/gatb/tools/misc/api/Vector.hpp