#include <DataBuffer.h>
DataBuffer.h
Basic class for holding byte buffers with type declaration. Data is stored as bytes and can be retrieved raw or cast as int32 or float.
Created on: June 2019 Author: Adan L. Benito
- Examples:
- Gui/gui-to-bela/render.cpp, Gui/mouse-track/render.cpp, and Gui/sequencer/render.cpp.
void DataBuffer::setup |
( |
char |
type, |
|
|
unsigned int |
size |
|
) |
| |
|
inline |
Setup function for the buffer.
- Parameters
-
type | Character representing the type contained by the buffer. |
size | Maximum size of the container. This is calculated assuming 32 bit floats & ints. |
unsigned int DataBuffer::getNumElements |
( |
| ) |
|
|
inline |
Get number of elements in buffer.
- Returns
- Number of elements in buffer.
unsigned int DataBuffer::getNumBytes |
( |
| ) |
|
|
inline |
Get number of bytes in buffer.
- Returns
- Size of container.
unsigned int DataBuffer::getCapacity |
( |
| ) |
|
|
inline |
Get maximum number of bytes that the buffer can hold.
- Returns
- Container's capacity.
char DataBuffer::getType |
( |
| ) |
|
|
inline |
std::vector<char>* DataBuffer::getBuffer |
( |
| ) |
|
|
inline |
- Returns
- Pointer to container.
char* DataBuffer::getAsChar |
( |
| ) |
|
|
inline |
- Returns
- Pointer to raw byte buffer
int32_t* DataBuffer::getAsInt |
( |
| ) |
|
|
inline |
- Returns
- Pointer to buffer contents cast as int32
float* DataBuffer::getAsFloat |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: