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

A basic signal reader that simplifies reading the signals's samples. More...

+ Inheritance diagram for GenericSampleReaderPtr< InterfaceType >:
+ Collaboration diagram for GenericSampleReaderPtr< InterfaceType >:

Detailed Description

template<typename InterfaceType>
class GenericSampleReaderPtr< InterfaceType >

A basic signal reader that simplifies reading the signals's samples.

Public Member Functions

daq::SampleType getValueReadType () const
 Gets the sample-type the signal value samples will be converted to when read or SampleType::Invalid if read-type has not been determined yet. More...
 
daq::SampleType getDomainReadType () const
 Gets the sample-type the signal domain samples will be converted to when read or SampleType::Invalid if read-type has not been determined yet. More...
 
void setValueTransformFunction (const daq::FunctionPtr &transform) const
 Sets the transform function that will be called with the read value-data and currently valid Signal-Descriptor giving the user the chance add a custom post-processing step. The function should have a signature compatible with: More...
 
void setDomainTransformFunction (const daq::FunctionPtr &transform) const
 Sets the transform function that will be called with the read domain-data and currently valid Signal-Descriptor giving the user the chance add a custom post-processing step. The function should have a signature compatible with: More...
 
daq::ReadMode getReadMode () const
 Gets the reader's read mode which determines if the reader will also scale the read data or not. More...
 
- Public Member Functions inherited from GenericReaderPtr< InterfaceType >
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

◆ getDomainReadType()

daq::SampleType getDomainReadType ( ) const
inline

Gets the sample-type the signal domain samples will be converted to when read or SampleType::Invalid if read-type has not been determined yet.

Returns
The sample-type type of the read samples otherwise SampleType::Invalid.

◆ getReadMode()

daq::ReadMode getReadMode ( ) const
inline

Gets the reader's read mode which determines if the reader will also scale the read data or not.

Returns
The mode the reader is in (either Raw or Scaled)

◆ getValueReadType()

daq::SampleType getValueReadType ( ) const
inline

Gets the sample-type the signal value samples will be converted to when read or SampleType::Invalid if read-type has not been determined yet.

Returns
The sample-type type of the read samples otherwise SampleType::Invalid.

◆ setDomainTransformFunction()

void setDomainTransformFunction ( const daq::FunctionPtr &  transform) const
inline

Sets the transform function that will be called with the read domain-data and currently valid Signal-Descriptor giving the user the chance add a custom post-processing step. The function should have a signature compatible with:

transform(Int inputBuffer, Int outputBuffer, SizeT toRead, IDataDescriptor* descriptor)
Describes the data sent by a signal, defining how they are to be interpreted by anyone receiving the ...
Definition: data_descriptor.h:125
Parameters
transformThe function performing the post-processing.

◆ setValueTransformFunction()

void setValueTransformFunction ( const daq::FunctionPtr &  transform) const
inline

Sets the transform function that will be called with the read value-data and currently valid Signal-Descriptor giving the user the chance add a custom post-processing step. The function should have a signature compatible with:

transform(Int inputBuffer, Int outputBuffer, SizeT toRead, IDataDescriptor* descriptor)
Parameters
transformThe function performing the post-processing.