Data Streams
-
template<class T, template<class...> class Template>
concept derived_from_specialization_of - #include <data_streams.h>
Concept that checks if a type is derived from a specialization of a template.
- tparam T:
The type to check.
- tparam Template:
The template specialization to check against.
-
inline receive_callback xdaq::DataStream::aligned_read_stream(receive_callback &&on_receive, std::size_t alignment)
Creates an aligned data stream callback for a device.
The BasicDevice::DataStream reads data in chunks of variable sizes, depending on what the device and driver support. This function adapts BasicDevice::DataStream to deliver data in chunks of a specified alignment. Since buffering is required, the AlignedDataStream takes ownership of the raw data buffer and only provides an aligned view of the data to the user.
Note
All data chunks delivered (except possibly the final one) will have a length that is a multiple of the specified alignment. The final chunk, delivered when the data stream stops, may contain fewer bytes than the alignment if insufficient data remains.
- Template Parameters:
Device – Any specialization of BasicDevice.
- Parameters:
on_receive – Callback to receive the aligned data chunks.
alignment – The alignment boundary for data chunks.
- Returns:
A callback of type typename Device::DataStream::receive_callback.
-
struct AlignedDataStream
Holds the necessary context for processing data aligned to a specific boundary.