Class to handle with lists of Data pointers.
More...
#include <variable.h>
|
| PtrVector () |
| Default constructor.
|
|
| PtrVector (const PtrVector &src) |
| Copy constructor.
|
|
virtual | ~PtrVector () |
| Virtual destructor.
|
|
PtrVector & | operator= (const PtrVector &src) |
| Assigment operator overload.
|
|
Data * | operator[] (size_t n) |
| Returns a reference to the element at position n in the vector container.
|
|
const Data * | operator[] (size_t n) const |
| Returns a reference to the element at position n in the vector container.
|
|
Data * | at (size_t n) |
| Returns a reference to the element at position n in the vector container.
|
|
const Data * | at (size_t n) const |
| Returns a reference to the element at position n in the vector container.
|
|
Data * | front () const |
| Get a reference to the first element in the container.
|
|
Data * | back () const |
| Get a reference to the last element in the container.
|
|
void | pushBack (const pData &value) |
| Appends the given element value to the end of the container.
|
|
void | popBack () |
| Removes the last element of the container.
|
|
void | resize (size_t count) |
| Resizes the container to contain count elements. The new element will be initialized with default values.
|
|
void | resize (size_t count, const pData &value) |
| Resizes the container to contain count elements.
|
|
size_t | size () const |
| Get the number of elements in the container.
|
|
void | clear () |
| Erases all elements from the container. After this call, size() returns zero.
|
|
Class to handle with lists of Data pointers.
◆ pPtrVector
◆ PtrVector() [1/2]
◆ PtrVector() [2/2]
Copy constructor.
Stored object copied from src will NOT be deleted upon clear or object deletion even if subsequently added with push commands
◆ ~PtrVector()
◆ at() [1/2]
Returns a reference to the element at position n in the vector container.
- Parameters
-
n | Position of an element in the container. |
- Returns
- The element at the specified position in the vector.
◆ at() [2/2]
const Data * at |
( |
size_t | n | ) |
const |
Returns a reference to the element at position n in the vector container.
- Parameters
-
n | Position of an element in the container. |
- Returns
- The element at the specified position in the vector.
◆ back()
Get a reference to the last element in the container.
- Returns
- A reference to the last element in the container.
◆ clear()
◆ front()
Get a reference to the first element in the container.
- Returns
- a reference to the first element in the container.
◆ operator=()
Assigment operator overload.
- Parameters
-
- Returns
- A reference to this object
Stored object copied from src will NOT be deleted upon clear or object deletion even if subsequently added with push commands
◆ operator[]() [1/2]
Data * operator[] |
( |
size_t | n | ) |
|
Returns a reference to the element at position n in the vector container.
- Parameters
-
n | Position of an element in the container. |
- Returns
- The element at the specified position in the vector.
◆ operator[]() [2/2]
const Data * operator[] |
( |
size_t | n | ) |
const |
Returns a reference to the element at position n in the vector container.
- Parameters
-
n | Position of an element in the container. |
- Returns
- The element at the specified position in the vector.
◆ popBack()
Removes the last element of the container.
◆ pushBack()
void pushBack |
( |
const pData & | value | ) |
|
◆ resize() [1/2]
void resize |
( |
size_t | count | ) |
|
Resizes the container to contain count elements. The new element will be initialized with default values.
- Parameters
-
count | The new size of the container |
◆ resize() [2/2]
void resize |
( |
size_t | count, |
|
|
const pData & | value ) |
Resizes the container to contain count elements.
- Parameters
-
count | The new size of the container |
value | The value to initialize the new elements with |
◆ size()
Get the number of elements in the container.
- Returns
- The number of elements in the container