OpenMS  2.4.0
Public Member Functions | Protected Attributes | List of all members
MSDataTransformingConsumer Class Reference

Transforming consumer of MS data. More...

#include <OpenMS/FORMAT/DATAACCESS/MSDataTransformingConsumer.h>

Inheritance diagram for MSDataTransformingConsumer:
IMSDataConsumer

Public Member Functions

 MSDataTransformingConsumer ()
 Constructor. More...
 
 ~MSDataTransformingConsumer () override
 Default destructor. More...
 
void setExpectedSize (Size, Size) override
 Set expected size of spectra and chromatograms to be consumed. More...
 
void consumeSpectrum (SpectrumType &s) override
 Consume a spectrum. More...
 
virtual void setSpectraProcessingPtr (void(*sproptr)(SpectrumType &))
 
void consumeChromatogram (ChromatogramType &c) override
 Consume a chromatogram. More...
 
virtual void setChromatogramProcessingPtr (void(*cproptr)(ChromatogramType &))
 
void setExperimentalSettings (const OpenMS::ExperimentalSettings &) override
 Set experimental settings (meta-data) of the data to be consumed. More...
 
- Public Member Functions inherited from IMSDataConsumer
virtual ~IMSDataConsumer ()
 

Protected Attributes

void(* sprocessing_ptr_ )(SpectrumType &)
 
void(* cprocessing_ptr_ )(ChromatogramType &)
 

Additional Inherited Members

- Public Types inherited from IMSDataConsumer
typedef MSSpectrum SpectrumType
 
typedef MSChromatogram ChromatogramType
 

Detailed Description

Transforming consumer of MS data.

Is able to transform a spectra on the fly while it is read using a function pointer that can be set on the object.

Note that the spectrum gets transformed in-place.

Constructor & Destructor Documentation

◆ MSDataTransformingConsumer()

◆ ~MSDataTransformingConsumer()

~MSDataTransformingConsumer ( )
inlineoverride

Default destructor.

Member Function Documentation

◆ consumeChromatogram()

void consumeChromatogram ( ChromatogramType )
inlineoverridevirtual

Consume a chromatogram.

The chromatogram will be consumed by the implementation and possibly modified.

Note
The implementation might not allow to consume spectra and chromatograms in any order
Parameters
sThe chromatogram to be consumed

Implements IMSDataConsumer.

References OpenMS::Constants::c.

◆ consumeSpectrum()

void consumeSpectrum ( SpectrumType s)
inlineoverridevirtual

Consume a spectrum.

The spectrum will be consumed by the implementation and possibly modified.

Note
The implementation might not allow to consume spectra and chromatograms in any order
Parameters
sThe spectrum to be consumed

Implements IMSDataConsumer.

◆ setChromatogramProcessingPtr()

virtual void setChromatogramProcessingPtr ( void(*)(ChromatogramType &)  cproptr)
inlinevirtual

◆ setExpectedSize()

void setExpectedSize ( Size  expectedSpectra,
Size  expectedChromatograms 
)
inlineoverridevirtual

Set expected size of spectra and chromatograms to be consumed.

Some implementations might care about the number of spectra and chromatograms to be consumed and need to be informed about this (usually before consuming starts).

Note
Calling this method is optional but good practice.
Parameters
expectedSpectraNumber of spectra expected
expectedChromatogramsNumber of chromatograms expected

Implements IMSDataConsumer.

◆ setExperimentalSettings()

void setExperimentalSettings ( const OpenMS::ExperimentalSettings exp)
inlineoverridevirtual

Set experimental settings (meta-data) of the data to be consumed.

Some implementations might need to know about the meta-data (or the context) of the spectra and chromatograms to be consumed. This method allows them learn this.

Note
Calling this method is optional but good practice.
Parameters
expExperimental settings meta data for the data to be consumed

Implements IMSDataConsumer.

◆ setSpectraProcessingPtr()

virtual void setSpectraProcessingPtr ( void(*)(SpectrumType &)  sproptr)
inlinevirtual

Member Data Documentation

◆ cprocessing_ptr_

void(* cprocessing_ptr_) (ChromatogramType &)
protected

◆ sprocessing_ptr_

void(* sprocessing_ptr_) (SpectrumType &)
protected