osgEarth 2.1.1
|
Public Member Functions | |
AutoBuffer (int size) | |
~AutoBuffer () | |
T & | operator[] (int i) const |
Private Member Functions | |
AutoBuffer (const AutoBuffer &) | |
Private Attributes | |
T | _store [N] |
T * | _heapStore |
T *const | _ptr |
Implements an array that is locally allocated if less than a given size; otherwise, it is allocated on the heap. This is useful if the common case can, for example, easily be allocated on the stack.
Definition at line 31 of file AutoBuffer.
seamless::AutoBuffer< T, N >::AutoBuffer | ( | int | size | ) | [inline] |
Definition at line 34 of file AutoBuffer.
: _heapStore(size > N ? new T[size] : 0), _ptr(size > N ? _heapStore : &_store[0]) { }
seamless::AutoBuffer< T, N >::~AutoBuffer | ( | ) | [inline] |
Definition at line 40 of file AutoBuffer.
{ delete [] _heapStore; }
seamless::AutoBuffer< T, N >::AutoBuffer | ( | const AutoBuffer< T, N > & | ) | [private] |
T& seamless::AutoBuffer< T, N >::operator[] | ( | int | i | ) | const [inline] |
Definition at line 45 of file AutoBuffer.
{ return _ptr[i]; }
T* seamless::AutoBuffer< T, N >::_heapStore [private] |
Definition at line 50 of file AutoBuffer.
T* const seamless::AutoBuffer< T, N >::_ptr [private] |
Definition at line 51 of file AutoBuffer.
T seamless::AutoBuffer< T, N >::_store[N] [private] |
Definition at line 49 of file AutoBuffer.