#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.
◆ setup()
| 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. |
◆ getNumElements()
| unsigned int DataBuffer::getNumElements |
( |
| ) |
|
|
inline |
Get number of elements in buffer.
- Returns
- Number of elements in buffer.
◆ getNumBytes()
| unsigned int DataBuffer::getNumBytes |
( |
| ) |
|
|
inline |
Get number of bytes in buffer.
- Returns
- Size of container.
◆ getCapacity()
| unsigned int DataBuffer::getCapacity |
( |
| ) |
|
|
inline |
Get maximum number of bytes that the buffer can hold.
- Returns
- Container's capacity.
◆ getType()
| char DataBuffer::getType |
( |
| ) |
|
|
inline |
◆ getBuffer()
| std::vector< char > * DataBuffer::getBuffer |
( |
| ) |
|
|
inline |
- Returns
- Pointer to container.
◆ getAsChar()
| char * DataBuffer::getAsChar |
( |
| ) |
|
|
inline |
- Returns
- Pointer to raw byte buffer
◆ getAsInt()
| int32_t * DataBuffer::getAsInt |
( |
| ) |
|
|
inline |
- Returns
- Pointer to buffer contents cast as int32
◆ getAsFloat()
| float * DataBuffer::getAsFloat |
( |
| ) |
|
|
inline |
The documentation for this class was generated from the following file: