Om
1.0.0
A universal framework for multimedia simulation
|
An array-based buffer class. More...
#include <omBuffer.h>
Public Member Functions | |
Buffer () | |
Create an empty buffer with the default initial capacity. More... | |
Buffer (Size initialCapacity) | |
Create an empty buffer with the specified initial capacity. More... | |
Buffer (Size initialCapacity, Float newResizeFactor) | |
Create an empty buffer with the specified initial capacity and resize factor. More... | |
Buffer (const Buffer &other) | |
Create an identical copy of the specified buffer. More... | |
~Buffer () | |
Destroy a buffer, deallocating all resources used. More... | |
Buffer & | operator= (const Buffer &other) |
Assign the contents of one array list to another, performing a deep copy. More... | |
Buffer & | append (const T &element) |
Append an element to the end of this buffer. More... | |
Buffer & | append (const T *source, Size numElements) |
Append the specified number of elements from the given array. More... | |
Buffer & | append (const util::Array< T > &array) |
Append all elements from the specified array to the end of the buffer. More... | |
Buffer & | append (const util::Array< T > &array, Size number) |
Append a certain number of elements from the specified array to the end of the buffer. More... | |
Buffer & | append (const Buffer &aBuffer) |
Append all data from the specified buffer. More... | |
Buffer & | operator<< (const T &element) |
Append an element to the end of this buffer. More... | |
Buffer & | operator<< (const util::Array< T > &array) |
Append all elements from the specified array to the end of the buffer. More... | |
Buffer & | operator<< (const Buffer &aBuffer) |
Append all data from the specified buffer. More... | |
void | clear () |
Clear the contents of the buffer, keeping its capacity intact. More... | |
util::Array< T > | toArray () const |
Convert the contents of this buffer to an array object. More... | |
operator util::Array< T > () | |
Convert the contents of this buffer to an array object. More... | |
const T * | getPointer () const |
Get a pointer pointing to the buffer's internal array. More... | |
Size | getSize () const |
Get the number of elements in the buffer. More... | |
Size | getCapacity () const |
Get the number of elements the buffer can hold without resizing. More... | |
Bool | setCapacity (Size newCapacity) |
Set the number of elements the buffer can hold. More... | |
Float | getResizeFactor () const |
Get the resize factor for this buffer. More... | |
void | setResizeFactor (Float newResizeFactor) |
Set the resize factor for this buffer, clamped to [1.1, 10.0]. More... | |
An array-based buffer class.
This class allows the user to accumulate elements in a resizing buffer, then use the buffer's array as a contiguous block of memory at some later point.
|
inline |
Create an empty buffer with the default initial capacity.
|
inline |
Create an empty buffer with the specified initial capacity.
|
inline |
Create an empty buffer with the specified initial capacity and resize factor.
|
inline |
Create an identical copy of the specified buffer.
|
inline |
Destroy a buffer, deallocating all resources used.
|
inline |
Assign the contents of one array list to another, performing a deep copy.
|
inline |
Append an element to the end of this buffer.
|
inline |
Append the specified number of elements from the given array.
|
inline |
Append all elements from the specified array to the end of the buffer.
|
inline |
Append a certain number of elements from the specified array to the end of the buffer.
|
inline |
Append all data from the specified buffer.
|
inline |
Append an element to the end of this buffer.
|
inline |
Append all elements from the specified array to the end of the buffer.
|
inline |
Append all data from the specified buffer.
|
inline |
Clear the contents of the buffer, keeping its capacity intact.
|
inline |
Convert the contents of this buffer to an array object.
|
inline |
Convert the contents of this buffer to an array object.
|
inline |
Get a pointer pointing to the buffer's internal array.
|
inline |
Get the number of elements in the buffer.
|
inline |
Get the number of elements the buffer can hold without resizing.
|
inline |
Set the number of elements the buffer can hold.
|
inline |
Get the resize factor for this buffer.
|
inline |
Set the resize factor for this buffer, clamped to [1.1, 10.0].