MDF Lib 2.2
Interface against MDF 3/4 files
Loading...
Searching...
No Matches
mdf::ISampleReduction Class Referenceabstract

Defines an interface to a sample reduction (SR) block. More...

#include <isamplereduction.h>

Inheritance diagram for mdf::ISampleReduction:
Collaboration diagram for mdf::ISampleReduction:

Public Member Functions

virtual void NofSamples (uint64_t nof_samples)=0
 Sets number of samples in the block.
 
virtual uint64_t NofSamples () const =0
 Returns number of samples.
 
virtual void Interval (double interval)=0
 Sets the interval value.
 
virtual double Interval () const =0
 Returns the interval value.
 
virtual void SyncType (SrSyncType type)
 Synchronization type. Example Time or number of samples.
 
virtual SrSyncType SyncType () const
 return type of synchronization.
 
virtual void Flags (uint8_t flags)
 Sets SR flags.
 
virtual uint8_t Flags () const
 Returns the SR flags.
 
virtual const IChannelGroupChannelGroup () const =0
 Returns its channel group.
 
template<typename T >
void GetChannelValue (const IChannel &channel, uint64_t sample, uint64_t array_index, SrValue< T > &value) const
 Returns the channel value for a specific sample.
 
template<typename T >
void GetEngValue (const IChannel &channel, uint64_t sample, uint64_t array_index, SrValue< T > &value) const
 Returns the scaled SR value.
 
virtual void ClearData ()=0
 Resets the internal SR data bytes.
 
template<>
void GetChannelValue (const IChannel &channel, uint64_t sample, uint64_t array_index, SrValue< std::string > &value) const
 Specialized function that return an unsigned value.
 
template<>
void GetEngValue (const IChannel &channel, uint64_t sample, uint64_t array_index, SrValue< std::string > &value) const
 Specialized function that returns SR values as strings.
 
- Public Member Functions inherited from mdf::IBlock
virtual ~IBlock ()=default
 Default destructor.
 
virtual int64_t Index () const =0
 File position within the file.
 
virtual std::string BlockType () const =0
 Returns the block type.
 

Protected Member Functions

virtual void GetChannelValueUint (const IChannel &channel, uint64_t sample, uint64_t array_index, SrValue< uint64_t > &value) const =0
 
virtual void GetChannelValueInt (const IChannel &channel, uint64_t sample, uint64_t array_index, SrValue< int64_t > &value) const =0
 
virtual void GetChannelValueDouble (const IChannel &channel, uint64_t sample, uint64_t array_index, SrValue< double > &value) const =0
 

Detailed Description

Sample reduction (SR) blocks stores min, max and average values for the all samples or for an interval of samples values.

Member Function Documentation

◆ GetChannelValue()

template<typename T >
void mdf::ISampleReduction::GetChannelValue ( const IChannel & channel,
uint64_t sample,
uint64_t array_index,
SrValue< T > & value ) const
Template Parameters
TType of vaƶue
Parameters
channelReference to the channel.
sampleSample index.
array_indexArray index. Only used for an array channel.
valueReturns the SR value.

◆ GetChannelValueDouble()

virtual void mdf::ISampleReduction::GetChannelValueDouble ( const IChannel & channel,
uint64_t sample,
uint64_t array_index,
SrValue< double > & value ) const
protectedpure virtual

Returns the value as a double value.

◆ GetChannelValueInt()

virtual void mdf::ISampleReduction::GetChannelValueInt ( const IChannel & channel,
uint64_t sample,
uint64_t array_index,
SrValue< int64_t > & value ) const
protectedpure virtual

brief Returns the value as an integer.

◆ GetChannelValueUint()

virtual void mdf::ISampleReduction::GetChannelValueUint ( const IChannel & channel,
uint64_t sample,
uint64_t array_index,
SrValue< uint64_t > & value ) const
protectedpure virtual

brief Returns the value as unsigned integer.

◆ GetEngValue()

template<typename T >
void mdf::ISampleReduction::GetEngValue ( const IChannel & channel,
uint64_t sample,
uint64_t array_index,
SrValue< T > & value ) const
Template Parameters
TType of value.
Parameters
channelReference to the channel
sampleSample index.
array_indexArray offset in case of array type.
valueReturns the SR sample value.

◆ Interval() [1/2]

virtual double mdf::ISampleReduction::Interval ( ) const
nodiscardpure virtual
Returns
The interval value.

◆ Interval() [2/2]

virtual void mdf::ISampleReduction::Interval ( double interval)
pure virtual

Sets the interval value. Note that the value is dependent on the synchronization type.

Parameters
intervalInterval value.

◆ NofSamples() [1/2]

virtual uint64_t mdf::ISampleReduction::NofSamples ( ) const
nodiscardpure virtual
Returns
Number of samples.

◆ NofSamples() [2/2]

virtual void mdf::ISampleReduction::NofSamples ( uint64_t nof_samples)
pure virtual
Parameters
nof_samplesNumber of sample values.

◆ SyncType()

virtual void mdf::ISampleReduction::SyncType ( SrSyncType type)
virtual
Parameters
typeType of synchronization

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