Heap-allocated dynamic I/O data buffer.
More...
#include <ddata.hxx>
Inherits io_data_cmn_t.
|
| | 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_t & | getTs (size_t batch=0) |
| | Get timestamp reference for batch.
|
| |
|
bool | hasTimestamp () |
| | Check if this buffer has per-batch timestamp storage.
|
| |
| io_ts_t & | operator[] (size_t batch) |
| | Get timestamp reference via bracket operator.
|
| |
Heap-allocated dynamic I/O data buffer.
Definition at line 20 of file ddata.hxx.
◆ 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
-
| t | Element size bytes (1, 2, 4, or 8). |
| n | Elements per batch (default 1). |
| m | Number of batches (default 1). |
| dt | Data type enum (default 0). |
| ts | Whether to include per-batch timestamp (default false). |
Definition at line 49 of file ddata.hxx.
References ALIGN_TO_WORD_SIZE().
◆ 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
-
| index | Element index within batch. |
| batch | Batch 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
-
| batch | Batch index (default 0). |
- Returns
- Void pointer to data.
Definition at line 180 of file ddata.hxx.
◆ 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.
◆ 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
-
| batch | Batch 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
-
| batch | Batch index (default 0). |
- Returns
- Reference to timestamp.
Definition at line 203 of file ddata.hxx.
◆ operator[]()
| io_ts_t & dawn::io_ddata_t::operator[] |
( |
size_t |
batch | ) |
|
|
inline |
Get timestamp reference via bracket operator.
- Parameters
-
- Returns
- Reference to timestamp.
Definition at line 113 of file ddata.hxx.
References getTs().
The documentation for this struct was generated from the following file: