openDAQ
Open data acquisition platform
GenericReaderPtr< InterfaceType > Class Template Reference

Controls how Reader read call time-outs are handled. More...

Detailed Description

template<typename InterfaceType>
class GenericReaderPtr< InterfaceType >

Controls how Reader read call time-outs are handled.

< When some segments are available return them immediately. When no segments are available return immediately when any arrive or time-out is exceeded.

< Wait for the requested amount or until time-out is exceeded.

A basic signal reader that simplifies accessing the signals's data stream.

Public Member Functions

daq::SizeT getAvailableCount () const
 Gets the number of segments available to read. More...
 
void setOnDataAvailable (const daq::ProcedurePtr &callback) const
 Sets the specified callback function to be called when there is available data in the reader. Pass nullptr to unset the callback. The callback should take no arguments. More...
 
daq::Bool getEmpty () const
 Checks if there is data to read. More...
 

Member Function Documentation

◆ getAvailableCount()

daq::SizeT getAvailableCount ( ) const
inline

Gets the number of segments available to read.

Returns
The number of available segments

◆ getEmpty()

daq::Bool getEmpty ( ) const
inline

Checks if there is data to read.

Returns
Set to true if there is data to read, false otherwise. This method returns true if there is data available to read. The data can be an event packet or a sufficient amount of data samples for minimum reading.

◆ setOnDataAvailable()

void setOnDataAvailable ( const daq::ProcedurePtr &  callback) const
inline

Sets the specified callback function to be called when there is available data in the reader. Pass nullptr to unset the callback. The callback should take no arguments.

Parameters
callbackThe callback function to be set or nullptr to unset it.