OpenMS
2.5.0
|
The interface of a consumer of spectra and chromatograms. More...
#include <OpenMS/INTERFACES/IMSDataConsumer.h>
Public Types | |
typedef MSSpectrum | SpectrumType |
typedef MSChromatogram | 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_t expectedSpectra, size_t 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... | |
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.
Implementations in OpenMS can be found in OpenMS/FORMAT/DATAACCESS
typedef MSChromatogram ChromatogramType |
typedef MSSpectrum SpectrumType |
|
inlinevirtual |
|
pure virtual |
Consume a chromatogram.
The chromatogram will be consumed by the implementation and possibly modified.
s | The chromatogram to be consumed |
Implemented in FullSwathFileConsumer, MSDataWritingConsumer, MSDataChainingConsumer, MSDataSqlConsumer, MSDataCachedConsumer, MSDataAggregatingConsumer, MSDataTransformingConsumer, MSDataStoringConsumer, NoopMSDataWritingConsumer, and NoopMSDataConsumer.
|
pure virtual |
Consume a spectrum.
The spectrum will be consumed by the implementation and possibly modified.
s | The spectrum to be consumed |
Implemented in MSDataWritingConsumer, MSDataChainingConsumer, MSDataSqlConsumer, MSDataAggregatingConsumer, MSDataCachedConsumer, MSDataTransformingConsumer, MSDataStoringConsumer, NoopMSDataWritingConsumer, NoopMSDataConsumer, and FullSwathFileConsumer.
|
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).
expectedSpectra | Number of spectra expected |
expectedChromatograms | Number of chromatograms expected |
Implemented in FullSwathFileConsumer, MSDataSqlConsumer, MSDataCachedConsumer, MSDataAggregatingConsumer, MSDataTransformingConsumer, NoopMSDataConsumer, MSDataChainingConsumer, MSDataStoringConsumer, and MSDataWritingConsumer.
|
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.
exp | Experimental settings meta data for the data to be consumed |
Implemented in MSDataTransformingConsumer, MSDataAggregatingConsumer, MSDataChainingConsumer, MSDataStoringConsumer, FullSwathFileConsumer, MSDataWritingConsumer, NoopMSDataWritingConsumer, MSDataSqlConsumer, MSDataCachedConsumer, and NoopMSDataConsumer.