Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages
Public Types | Public Member Functions | List of all members
IMSDataConsumer< MapType > Class Template Referenceabstract

The interface of a consumer of spectra and chromatograms. More...

#include <OpenMS/INTERFACES/IMSDataConsumer.h>

Public Types

typedef MapType::SpectrumType SpectrumType
 
typedef MapType::ChromatogramType ChromatogramType
 

Public Member Functions

virtual ~IMSDataConsumer ()
 
virtual void consumeSpectrum (SpectrumType &s)=0
 Consume a spectrum. More...
 
virtual void consumeChromatogram (ChromatogramType &)=0
 Consume a chromatogram. More...
 
virtual void setExpectedSize (Size expectedSpectra, Size expectedChromatograms)=0
 Set expected size of spectra and chromatograms to be consumed. More...
 
virtual void setExperimentalSettings (const ExperimentalSettings &exp)=0
 Set experimental settings (meta-data) of the data to be consumed. More...
 

Detailed Description

template<typename MapType = MSExperiment<>>
class OpenMS::Interfaces::IMSDataConsumer< MapType >

The interface of a consumer of spectra and chromatograms.

The data consumer is able to consume data of type MSSpectrum and MSChromatogram and process them (it may modify the spectra). The consumer interface may be used when data is generated sequentially (e.g. by reading from disc) and needs to be processed as fast as possible without ever holding the full set of data in memory.

The consumer expects to be informed about the number of spectra and chromatograms to consume and potentially about the ExperimentalSettings before_consuming any spectra. This can be critical for consumers who write data to disk. Depending on the implementation, an exception may occur if the ExperimentalSettings and the size of the experiment are not set before consuming any spectra.

Note
The member functions setExpectedSize and setExperimentalSettings are expected to be called before consuming starts.

Member Typedef Documentation

Constructor & Destructor Documentation

virtual ~IMSDataConsumer ( )
inlinevirtual

Member Function Documentation

virtual void consumeChromatogram ( ChromatogramType )
pure virtual

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

Implemented in MSDataChainingConsumer, and NoopMSDataConsumer.

Referenced by OpenSwathWorkflow::performExtraction().

virtual void consumeSpectrum ( SpectrumType s)
pure virtual

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

Implemented in MSDataChainingConsumer, and NoopMSDataConsumer.

Referenced by MzXMLHandler< MapType >::populateSpectraWithData_().

virtual void setExpectedSize ( Size  expectedSpectra,
Size  expectedChromatograms 
)
pure virtual

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

Implemented in MSDataWritingConsumer, FullSwathFileConsumer, MSDataCachedConsumer, MSDataChainingConsumer, MSDataTransformingConsumer, and NoopMSDataConsumer.

Referenced by MzXMLFile::transformFirstPass_(), and MzMLFile::transformFirstPass_().

virtual void setExperimentalSettings ( const ExperimentalSettings exp)
pure virtual

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

Implemented in NoopMSDataWritingConsumer, MSDataWritingConsumer, FullSwathFileConsumer, MSDataCachedConsumer, MSDataTransformingConsumer, MSDataChainingConsumer, and NoopMSDataConsumer.

Referenced by MzXMLFile::transformFirstPass_(), and MzMLFile::transformFirstPass_().


OpenMS / TOPP release 2.0.0 Documentation generated on Thu Aug 20 2015 01:44:42 using doxygen 1.8.9.1