![]() |
Fledge
An open source edge computing platform for industrial users
|
Buffer type for storage of arbitrary buffers of data within a datapoint. More...
#include <databuffer.h>
Public Member Functions | |
DataBuffer (size_t itemSize, size_t len) | |
Buffer constructor. More... | |
DataBuffer (const DataBuffer &rhs) | |
DataBuffer copy constructor. More... | |
DataBuffer & | operator= (const DataBuffer &rhs) |
~DataBuffer () | |
DataBuffer destructor. | |
void | populate (void *src, int len) |
Populate the contents of a DataBuffer. More... | |
size_t | getItemSize () |
Return the size of each item in the buffer. | |
size_t | getItemCount () |
Return the number of items in the buffer. | |
void * | getData () |
Return a pointer to the raw data in the data buffer. | |
Protected Attributes | |
size_t | m_itemSize |
size_t | m_len |
void * | m_data |
Buffer type for storage of arbitrary buffers of data within a datapoint.
A DataBuffer is essentially a 1 dimensional array of a memory primitive of itemSize.
DataBuffer::DataBuffer | ( | size_t | itemSize, |
size_t | len | ||
) |
Buffer constructor.
itemSize | The size of each item in the buffer |
len | The length of the buffer, i.e. how many items can it hold |
DataBuffer::DataBuffer | ( | const DataBuffer & | rhs | ) |
DataBuffer copy constructor.
rhs | DataBuffer to copy |
void DataBuffer::populate | ( | void * | src, |
int | len | ||
) |
Populate the contents of a DataBuffer.
src | Source of the data |
len | Number of bytes in the source to copy |