MPD
0.20.18
|
An array allocated on the heap with a length determined at runtime. More...
#include <Util.hxx>
Public Types | |
typedef Buffer::size_type | size_type |
typedef Buffer::reference_type | reference_type |
typedef Buffer::const_reference_type | const_reference_type |
typedef Buffer::iterator | iterator |
typedef Buffer::const_iterator | const_iterator |
Public Member Functions | |
constexpr | AllocatedArray ()=default |
AllocatedArray (size_type _size) | |
AllocatedArray (const AllocatedArray &other) | |
AllocatedArray (AllocatedArray &&other) | |
~AllocatedArray () | |
AllocatedArray & | operator= (const AllocatedArray &other) |
AllocatedArray & | operator= (AllocatedArray &&other) |
constexpr bool | IsNull () const |
constexpr bool | empty () const |
Returns true if no memory was allocated so far. More... | |
constexpr size_type | size () const |
Returns the number of allocated elements. More... | |
reference_type | front () |
const_reference_type | front () const |
reference_type | back () |
const_reference_type | back () const |
reference_type | operator[] (size_type i) |
Returns one element. More... | |
const_reference_type | operator[] (size_type i) const |
Returns one constant element. More... | |
iterator | begin () |
constexpr const_iterator | begin () const |
iterator | end () |
constexpr const_iterator | end () const |
void | ResizeDiscard (size_type _size) |
Resizes the array, discarding old data. More... | |
void | GrowDiscard (size_type _size) |
Grows the array to the specified size, discarding old data. More... | |
void | GrowPreserve (size_type _size, size_type preserve) |
Grows the array to the specified size, preserving the value of a range of elements, starting from the beginning. More... | |
void | SetSize (size_type _size) |
Declare that the buffer has the specified size. More... | |
Protected Attributes | |
Buffer buffer | nullptr |
An array allocated on the heap with a length determined at runtime.
typedef Buffer::const_iterator AllocatedArray< T >::const_iterator |
Definition at line 52 of file AllocatedArray.hxx.
typedef Buffer::const_reference_type AllocatedArray< T >::const_reference_type |
Definition at line 50 of file AllocatedArray.hxx.
typedef Buffer::iterator AllocatedArray< T >::iterator |
Definition at line 51 of file AllocatedArray.hxx.
typedef Buffer::reference_type AllocatedArray< T >::reference_type |
Definition at line 49 of file AllocatedArray.hxx.
typedef Buffer::size_type AllocatedArray< T >::size_type |
Definition at line 48 of file AllocatedArray.hxx.
|
default |
|
inlineexplicit |
Definition at line 60 of file AllocatedArray.hxx.
|
inlineexplicit |
Definition at line 65 of file AllocatedArray.hxx.
|
inline |
Definition at line 73 of file AllocatedArray.hxx.
|
inline |
Definition at line 78 of file AllocatedArray.hxx.
|
inline |
Definition at line 125 of file AllocatedArray.hxx.
|
inline |
Definition at line 129 of file AllocatedArray.hxx.
|
inline |
Definition at line 151 of file AllocatedArray.hxx.
|
inline |
Definition at line 155 of file AllocatedArray.hxx.
|
inline |
Returns true if no memory was allocated so far.
Definition at line 106 of file AllocatedArray.hxx.
|
inline |
Definition at line 159 of file AllocatedArray.hxx.
|
inline |
Definition at line 163 of file AllocatedArray.hxx.
|
inline |
Definition at line 117 of file AllocatedArray.hxx.
|
inline |
Definition at line 121 of file AllocatedArray.hxx.
|
inline |
Grows the array to the specified size, discarding old data.
Similar to ResizeDiscard(), but will never shrink the array to avoid expensive heap operations.
Definition at line 186 of file AllocatedArray.hxx.
|
inline |
Grows the array to the specified size, preserving the value of a range of elements, starting from the beginning.
Definition at line 195 of file AllocatedArray.hxx.
|
inline |
Definition at line 99 of file AllocatedArray.hxx.
|
inline |
Definition at line 82 of file AllocatedArray.hxx.
|
inline |
Definition at line 94 of file AllocatedArray.hxx.
|
inline |
|
inline |
Returns one constant element.
No bounds checking.
Definition at line 145 of file AllocatedArray.hxx.
|
inline |
Resizes the array, discarding old data.
Definition at line 170 of file AllocatedArray.hxx.
|
inline |
Declare that the buffer has the specified size.
Must not be larger than the current size. Excess elements are not used (but they are still allocated).
Definition at line 214 of file AllocatedArray.hxx.
|
inline |
Returns the number of allocated elements.
Definition at line 113 of file AllocatedArray.hxx.
|
protected |
Definition at line 55 of file AllocatedArray.hxx.