LightsprintSDK 2021.08.08
|
#include <RRVector.h>
Public Member Functions | |
RRVector () | |
RRVector (const RRVector &a) | |
RRVector & | operator= (const RRVector &a) |
void | resize (unsigned newSize, C initial=C()) |
void | push_back (C a) |
void | pop_back () |
void | erase (C *e) |
size_t | size () const |
C & | operator[] (unsigned i) |
const C & | operator[] (unsigned i) const |
void | clear () |
C * | begin () |
const C * | begin () const |
C * | end () |
const C * | end () const |
void | insert (C *_where, const C *_first, const C *_last) |
bool | operator== (const RRVector< C > &a) const |
bool | operator!= (const RRVector< C > &a) const |
~RRVector () | |
Protected Attributes | |
C * | c |
unsigned | numAllocated |
unsigned | numUsed |
Portable but limited, minimalistic std::vector replacement.
It works like std::vector in simple cases in Lightsprint SDK interface where C is pointer, RRObject* or RRLight*, and vector size is small (no risk of allocation failure). It is not suitable for anything more complex.
Purpose of RRVector used to be to replace STL in public Lightsprint headers, to make Lightsprint binaries work with any STL implementation. It is also bit smaller than std::vector.
|
inline |
Creates empty vector (like std::vector).
|
inline |
Creates vector by copying. Uses memcpy to copy elements (unlike std::vector).
!! failure not handled
|
inline |
Frees elements. Doesn't call element destructors (unlike std::vector).
|
inline |
Assigns vector. Uses memcpy to copy elements (unlike std::vector).
!! failure not handled
|
inline |
Resizes vector, adding or removing elements at the end. Does not destruct removed elements (unlike std::vector).
|
inline |
Appends element at the end of vector. Elements may be relocated to different address in memory. Does shallow copy at relocation (unlike std::vector).
!! failure not handled
|
inline |
Removes last element from vector. Destructor is not called (unlike std::vector).
|
inline |
Removes i-th element from vector. Destructor is not called (unlike std::vector).
|
inline |
Returns number of elements in vector (like std::vector).
|
inline |
Returns reference to i-th element (like std::vector).
|
inline |
Returns const reference to i-th element (like std::vector).
|
inline |
Clear all elements from vector, setting size to 0. Doesn't call element destructors (unlike std::vector).
|
inline |
Returns iterator pointing to first element (like std::vector).
|
inline |
|
inline |
Returns iterator pointing beyond last element (like std::vector).
|
inline |
|
inline |
Inserts range of elements. Destination must be end of current vector (unlike std::vector).
|
inline |
|
inline |
|
protected |
|
protected |
|
protected |