OpenMS
|
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 &c)=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.
c | The chromatogram to be consumed |
Implemented in FullSwathFileConsumer, MSDataWritingConsumer, MSDataTransformingConsumer, MSDataStoringConsumer, MSDataSqlConsumer, MSDataChainingConsumer, MSDataCachedConsumer, MSDataAggregatingConsumer, NoopMSDataConsumer, and NoopMSDataWritingConsumer.
|
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, MSDataTransformingConsumer, MSDataStoringConsumer, MSDataSqlConsumer, MSDataChainingConsumer, MSDataCachedConsumer, MSDataAggregatingConsumer, NoopMSDataConsumer, NoopMSDataWritingConsumer, 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, NoopMSDataConsumer, MSDataTransformingConsumer, MSDataSqlConsumer, MSDataCachedConsumer, MSDataAggregatingConsumer, MSDataStoringConsumer, MSDataChainingConsumer, 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, MSDataStoringConsumer, MSDataChainingConsumer, FullSwathFileConsumer, MSDataWritingConsumer, NoopMSDataConsumer, NoopMSDataWritingConsumer, MSDataSqlConsumer, and MSDataCachedConsumer.