#include <Puma/VoidPtrArray.h>
Array implementation specialized for void pointers.
|
| | VoidPtrArray (long is=default_init_size, long incr=default_increment) |
| | Constructor.
|
| |
| | VoidPtrArray (const VoidPtrArray &array) |
| | Copy-constructor.
|
| |
| VoidPtrArray & | operator= (const VoidPtrArray &array) |
| | Assignment operator.
|
| |
| | ~VoidPtrArray () |
| | Destructor.
|
| |
| void | append (const void *item) |
| | Append an item to the array.
|
| |
| void | insert (long index, const void *item) |
| | Insert an item at the given array index.
|
| |
| void | prepend (const void *item) |
| | Prepend an item.
|
| |
| void | remove (long index) |
| | Remove the array item at the given array index.
|
| |
| void | reset () |
| | Reset the array.
|
| |
| void *& | get (long index) |
| | Get a reference to the array item at the given array index.
|
| |
| void *& | operator[] (long index) |
| | Get a reference to the array item at the given array index.
|
| |
| void * | fetch (long index) const |
| | Get the array item at the given array index.
|
| |
| void *& | lookup (long index) const |
| | Get a reference to the array item at the given array index.
|
| |
| long | length () const |
| | Get the number of items in the array.
|
| |
◆ VoidPtrArray() [1/2]
Constructor.
- Parameters
-
| is | The default size of the array. |
| incr | The default increment value. |
◆ VoidPtrArray() [2/2]
| Puma::VoidPtrArray::VoidPtrArray |
( |
const VoidPtrArray & | array | ) |
|
|
inlineprotected |
Copy-constructor.
- Parameters
-
◆ ~VoidPtrArray()
| Puma::VoidPtrArray::~VoidPtrArray |
( |
| ) |
|
|
inlineprotected |
Destructor.
Destroys the array.
◆ append()
| void Puma::VoidPtrArray::append |
( |
const void * | item | ) |
|
|
inlineprotected |
Append an item to the array.
- Parameters
-
◆ fetch()
| void * Puma::VoidPtrArray::fetch |
( |
long | index | ) |
const |
|
inlineprotected |
Get the array item at the given array index.
Does not return a reference, thus the item may be implicitely copied.
- Warning
- Does not validate the index!
- Parameters
-
- Returns
- The n-th array item.
◆ get()
| void *& Puma::VoidPtrArray::get |
( |
long | index | ) |
|
|
inlineprotected |
Get a reference to the array item at the given array index.
If the index exceeds the array bounds, then the array is reallocated accordingly.
- Parameters
-
- Returns
- A reference to the n-th array item.
◆ insert()
| void Puma::VoidPtrArray::insert |
( |
long | index, |
|
|
const void * | item ) |
|
inlineprotected |
Insert an item at the given array index.
- Parameters
-
| index | The array index. |
| item | The item to insert. |
◆ length()
| long Puma::VoidPtrArray::length |
( |
| ) |
const |
|
inlineprotected |
Get the number of items in the array.
- Returns
- The length of the array.
◆ lookup()
| void *& Puma::VoidPtrArray::lookup |
( |
long | index | ) |
const |
|
inlineprotected |
Get a reference to the array item at the given array index.
- Warning
- Does not validate the index!
- Parameters
-
- Returns
- A reference to the n-th array item.
◆ operator=()
Assignment operator.
- Parameters
-
- Returns
- A reference to this array.
◆ operator[]()
| void *& Puma::VoidPtrArray::operator[] |
( |
long | index | ) |
|
|
inlineprotected |
Get a reference to the array item at the given array index.
If the index exceeds the array bounds, then the array is reallocated accordingly.
- Parameters
-
- Returns
- A reference to the n-th array item.
◆ prepend()
| void Puma::VoidPtrArray::prepend |
( |
const void * | item | ) |
|
|
inlineprotected |
Prepend an item.
- Parameters
-
◆ remove()
| void Puma::VoidPtrArray::remove |
( |
long | index | ) |
|
|
inlineprotected |
Remove the array item at the given array index.
- Parameters
-
◆ reset()
| void Puma::VoidPtrArray::reset |
( |
| ) |
|
|
inlineprotected |
Reset the array.
Destroys the current array.
◆ default_increment
| const long Puma::VoidPtrArray::default_increment |
|
staticprotected |
Default array size increment.
◆ default_init_size
| const long Puma::VoidPtrArray::default_init_size |
|
staticprotected |