Fledge
An open source edge computing platform for industrial users
DataBuffer Class Reference

Buffer type for storage of arbitrary buffers of data within a datapoint. More...

#include <databuffer.h>

Inheritance diagram for DataBuffer:

Public Member Functions

 DataBuffer (size_t itemSize, size_t len)
 Buffer constructor. More...
 
 DataBuffer (const DataBuffer &rhs)
 DataBuffer copy constructor. More...
 
DataBufferoperator= (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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DataBuffer() [1/2]

DataBuffer::DataBuffer ( size_t  itemSize,
size_t  len 
)

Buffer constructor.

Parameters
itemSizeThe size of each item in the buffer
lenThe length of the buffer, i.e. how many items can it hold

◆ DataBuffer() [2/2]

DataBuffer::DataBuffer ( const DataBuffer rhs)

DataBuffer copy constructor.

Parameters
rhsDataBuffer to copy

Member Function Documentation

◆ populate()

void DataBuffer::populate ( void *  src,
int  len 
)

Populate the contents of a DataBuffer.

Parameters
srcSource of the data
lenNumber of bytes in the source to copy

The documentation for this class was generated from the following files: