Classes |
class | const_iterator |
| Custom iterator for svector. More...
|
class | iterator |
| Custom iterator for svector. More...
|
Public Member Functions |
| svector () |
| Default constructor.
|
| svector (const svector< T > &other) |
| Construct from another svector.
|
| svector (uint n) |
| Constructs a vector of n empty elements.
|
virtual void | clear () |
| Unlocks all elements and clears the pointers in this vector.
|
virtual void | clear (uint i) |
| Unlocks element 'i' and set it to empty (NULL).
|
virtual T & | operator[] (uint i) |
| Returns a reference to T at index 'i'.
|
virtual const T & | at_const (uint i) const |
| Returns a reference to T at index 'i'.
|
virtual bool | exists (uint i) const |
| Returns true if element 'i' is empty, false otherwise.
|
virtual uint | size_existing () const |
| Returns the number of non-empty elements.
|
virtual void | remove (uint i) |
virtual void | remove (uint start, uint end) |
| Remove all elements between 'start' and 'end' (included).
|
virtual void | remove_empty () |
virtual void | push_front (T &e) |
| Lock 'e' and and push its address to the front of this.
|
virtual void | push_front_new (T &e) |
| Allocates a copy of 'e', lock it and push it to the front of this.
|
virtual void | push_back (T *e) |
| Lock and push an element 'e' to the end of this vector.
|
virtual void | push_back (T &e) |
| Lock and push an element 'e' to the end of this vector.
|
virtual void | push_back_new (const T &e) |
| Allocates a copy of 'e', lock it and push it to the end of this vector.
|
virtual void | push_back_new (const T *e) |
| Allocates a copy of 'e', lock it and push it to the end of this vector.
|
virtual void | push_back (std::vector< T * > &v) |
| Lock and push all elements of 'v' to the end of this vector.
|
virtual void | push_back (svector< T > &v) |
| Lock and push all elements of 'v' to the end of this vector.
|
virtual void | push_back_new (const svector< T > &v) |
| Allocate new, lock and push all elements of 'v' to the end of this.
|
virtual void | push_back_empty () |
| Push an empty element (null) to the end of this vector.
|
virtual void | set (T &e, uint n) |
| Unlocks element at index 'n' and replace it with 'e' (and lock it).
|
virtual void | set_new (T &e, uint n) |
| Unlocks element at index 'n' and replace it with a new 'e'(and lock it).
|
virtual void | operator= (svector< T > v) |
| Clear all elements, then lock and push all elements of 'v' to the end.
|
virtual void | swap (uint i, uint j) |
| Swap elements 'i' and 'j'.
|
virtual svector< T > | copy () |
| Returns a svector that contains copies of each element of this.
|
virtual void | copy (const svector< T > &other) |
| Clear this and allocate copies of all elements of 'other' into this one.
|
virtual void | copy (svector< T > &other) |
| Clear this and allocate copies of all elements of 'other' into this one.
|
virtual svector< T > | narrow (uint n, uint offset) |
| Returns an midxd with 'n' elements starting at 'offset'.
|
virtual void | resize_default (uint n) |
virtual void | randomize () |
| Randomizes order of elements.
|
virtual iterator | begin (uint offset=0) |
virtual const_iterator | begin (uint offset=0) const |
void | lock_all () |
Protected Member Functions |
void | unlock_all () |
| Unlock all idx contained in this midx.
|
void | unlock_range (uint start, uint end) |
| Unlock all elements between 'start' and 'end' (included).
|
Protected Attributes |
std::vector< T * >::iterator | it |
template<class T>
class ebl::svector< T >
A smart vector that handles smart pointers, i.e. this vector must be given dynamically allocated objects and will handle their deletion automatically.