WvStreams
|
A buffer that wraps a pre-allocated array and provides read-only access to its elements. More...
#include <wvbufbase.h>
Public Member Functions | |
WvConstInPlaceBufBase (const T *_data, size_t _avail) | |
Creates a new buffer backed by the supplied array. More... | |
WvConstInPlaceBufBase () | |
Creates a new empty buffer with no backing array. | |
virtual | ~WvConstInPlaceBufBase () |
Destroys the buffer. More... | |
const T * | ptr () const |
Returns the underlying array pointer. More... | |
void | reset (const T *_data, size_t _avail) |
Resets the underlying buffer pointer and properties. More... | |
void | setavail (size_t _avail) |
Sets the amount of available data using the current buffer and resets the read index to the beginning of the buffer. More... | |
Protected Types | |
typedef T | Elem |
Protected Attributes | |
WvConstInPlaceBufStore | mystore |
A buffer that wraps a pre-allocated array and provides read-only access to its elements.
"T" is the type of object to store, must be a primitive or a struct without special initialization, copy, or assignment semantics
Definition at line 727 of file wvbufbase.h.
|
inline |
Creates a new buffer backed by the supplied array.
"_data" is the array of data to wrap "_avail" is the amount of data available for reading
Definition at line 741 of file wvbufbase.h.
|
inlinevirtual |
|
inline |
Returns the underlying array pointer.
Returns: the element pointer
Definition at line 763 of file wvbufbase.h.
|
inline |
Resets the underlying buffer pointer and properties.
Never frees the old buffer.
"_data" is the array of data to wrap "_avail" is the amount of data available for reading
Definition at line 777 of file wvbufbase.h.
|
inline |
Sets the amount of available data using the current buffer and resets the read index to the beginning of the buffer.
"_avail" is the amount of data available for reading
Definition at line 788 of file wvbufbase.h.