Dawn Framework 1.0
Universal data acquisition framework for embedded systems
Public Member Functions | List of all members
dawn::io_ddata_t Struct Reference

Heap-allocated dynamic I/O data buffer. More...

#include <ddata.hxx>

Inherits io_data_cmn_t.

Public Member Functions

 io_ddata_t (size_t t, size_t n=1, size_t m=1, uint8_t dt=0, bool ts=false)
 Constructor - allocate heap buffer with M batches.
 
 ~io_ddata_t ()
 Destructor - deallocate heap buffer.
 
size_t ALIGN_TO_WORD_SIZE (size_t size, size_t word_size)
 Align size to word boundary.
 
template<typename T >
T & get (size_t index, size_t batch=0)
 Get data element by index and batch (type-safe).
 
size_t getBatch () const
 Get number of batches.
 
size_t getBufferSize () const
 Get total buffer size in bytes.
 
void * getDataPtr (size_t batch=0)
 Get pointer to data only (skips timestamp if present).
 
size_t getDataSize ()
 Get data size in bytes.
 
uint8_t getDtype () const
 Get data type enum for introspection.
 
size_t getItems ()
 Get number of items per batch.
 
void * getPtr (size_t batch=0)
 Get pointer to batch.
 
size_t getSize () const
 Get element size in bytes.
 
io_ts_tgetTs (size_t batch=0)
 Get timestamp reference for batch.
 
bool hasTimestamp ()
 Check if this buffer has per-batch timestamp storage.
 
io_ts_toperator[] (size_t batch)
 Get timestamp reference via bracket operator.
 

Detailed Description

Heap-allocated dynamic I/O data buffer.

Definition at line 20 of file ddata.hxx.

Constructor & Destructor Documentation

◆ io_ddata_t()

dawn::io_ddata_t::io_ddata_t ( size_t  t,
size_t  n = 1,
size_t  m = 1,
uint8_t  dt = 0,
bool  ts = false 
)
inlineexplicit

Constructor - allocate heap buffer with M batches.

Parameters
tElement size bytes (1, 2, 4, or 8).
nElements per batch (default 1).
mNumber of batches (default 1).
dtData type enum (default 0).
tsWhether to include per-batch timestamp (default false).

Definition at line 49 of file ddata.hxx.

References ALIGN_TO_WORD_SIZE().

Here is the call graph for this function:

Member Function Documentation

◆ get()

template<typename T >
T & dawn::io_ddata_t::get ( size_t  index,
size_t  batch = 0 
)
inline

Get data element by index and batch (type-safe).

Parameters
indexElement index within batch.
batchBatch index (default 0).
Returns
Reference to data element.

Definition at line 93 of file ddata.hxx.

◆ getDataPtr()

void * dawn::io_ddata_t::getDataPtr ( size_t  batch = 0)
inline

Get pointer to data only (skips timestamp if present).

Parameters
batchBatch index (default 0).
Returns
Void pointer to data.

Definition at line 180 of file ddata.hxx.

Here is the caller graph for this function:

◆ getDataSize()

size_t dawn::io_ddata_t::getDataSize ( )
inline

Get data size in bytes.

Returns the size of a single data item (without timestamp if present).

Definition at line 153 of file ddata.hxx.

Here is the caller graph for this function:

◆ getPtr()

void * dawn::io_ddata_t::getPtr ( size_t  batch = 0)
inline

Get pointer to batch.

When hasTs is true, returns pointer to [timestamp + data]. When hasTs is false, returns pointer to [data] (same as getDataPtr).

Parameters
batchBatch index (default 0).
Returns
Void pointer to batch.

Definition at line 168 of file ddata.hxx.

◆ getTs()

io_ts_t & dawn::io_ddata_t::getTs ( size_t  batch = 0)
inline

Get timestamp reference for batch.

When hasTs is true, returns per-batch timestamp from buffer. When hasTs is false, returns shared dummy reference.

Parameters
batchBatch index (default 0).
Returns
Reference to timestamp.

Definition at line 203 of file ddata.hxx.

Here is the caller graph for this function:

◆ operator[]()

io_ts_t & dawn::io_ddata_t::operator[] ( size_t  batch)
inline

Get timestamp reference via bracket operator.

Parameters
batchBatch index.
Returns
Reference to timestamp.

Definition at line 113 of file ddata.hxx.

References getTs().

Here is the call graph for this function:

The documentation for this struct was generated from the following file: