OpenMS  2.6.0
Classes | Public Types | Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ProgressLogger Class Reference

Base class for all classes that want to report their progress. More...

#include <OpenMS/CONCEPT/ProgressLogger.h>

Inherited by AccurateMassSearchEngine, AverageLinkage, BaseGroupFinder, BaseSuperimposer, BasicProteinInferenceAlgorithm, BayesianProteinInferenceAlgorithm, ChromatogramExtractor, ChromatogramExtractorAlgorithm, CompleteLinkage, ConfidenceScoring, ConsensusMapMergerAlgorithm, ConsensusXMLFile, DTA2DFile, ElutionPeakDetection, FeatureFinder, FeatureFinderMultiplexAlgorithm, FeatureFindingMetabo, FeatureGroupingAlgorithmKD, FeatureXMLFile, GaussFilter, GridBasedClustering< Metric >, IDMergerAlgorithm, IdXMLFile, CachedMzMLHandler, InternalCalibration, IonizationSimulation, LinearResampler, MapAlignmentAlgorithmIdentification, MapAlignmentAlgorithmPoseClustering, MapAlignmentAlgorithmSpectrumAlignment, MapAlignmentAlgorithmTreeGuided, MascotGenericFile, MascotInfile, MasstraceCorrelator, MassTraceDetection, MetaboliteSpectralMatching, MorphologicalFilter, MRMAssay, MRMDecoy, MRMFeatureFinderScoring, MRMFeatureQCFile, MS2File, MSSim, MultiplexClustering, MultiplexFiltering, MzDataFile, MzIdentMLFile, MzMLFile, MzQuantMLFile, MzXMLFile, OpenPepXLAlgorithm, OpenPepXLLFAlgorithm, OpenSwathWorkflowBase, PeakPickerCWT, PeakPickerHiRes, PeakPickerIterative, PeakPickerSH, PeptideIndexing, QcMLFile, RawMSSignalSimulation, SavitzkyGolayFilter, SignalToNoiseEstimator< Container >, SimpleSearchEngineAlgorithm, SingleLinkage, SpectraMerger, SVMWrapper, SwathFile, TOFCalibration, ToolDescriptionFile, TraMLFile, TransitionTSVFile, XFDRAlgorithm, XMassFile, XQuestResultXMLFile, SignalToNoiseEstimator< ContainerT >, and SignalToNoiseEstimator< OpenMS::MSChromatogram >.

Collaboration diagram for ProgressLogger:


class  ProgressLoggerImpl
 This class represents an actual implementation of a logger. More...

Public Types

enum  LogType { CMD, GUI, NONE }
 Possible log types. More...

Public Member Functions

 ProgressLogger ()
 Constructor. More...
 ~ProgressLogger ()
 Destructor. More...
 ProgressLogger (const ProgressLogger &other)
 Copy constructor. More...
ProgressLoggeroperator= (const ProgressLogger &other)
 Assignment Operator. More...
void setLogType (LogType type) const
 Sets the progress log that should be used. The default type is NONE! More...
LogType getLogType () const
 Returns the type of progress log being used. More...
void startProgress (SignedSize begin, SignedSize end, const String &label) const
 Initializes the progress display. More...
void setProgress (SignedSize value) const
 Sets the current progress. More...
void endProgress () const
 Ends the progress display. More...
void nextProgress () const
 increment progress by 1 (according to range begin-end) More...

Static Protected Member Functions

static String logTypeToFactoryName_ (LogType type)
 Return the name of the factory product used for this log type. More...

Protected Attributes

LogType type_
time_t last_invoke_

Static Protected Attributes

static int recursion_depth_

Detailed Description

Base class for all classes that want to report their progress.

Per default the progress log is disabled. Use setLogType to enable it.

Use startProgress, setProgress and endProgress for the actual logging.

All methods are const, so it can be used through a const reference or in const methods as well!

Member Enumeration Documentation

◆ LogType

enum LogType

Possible log types.


Command line progress.


Progress dialog.


No progress logging.

Constructor & Destructor Documentation

◆ ProgressLogger() [1/2]


◆ ~ProgressLogger()


◆ ProgressLogger() [2/2]

ProgressLogger ( const ProgressLogger other)

Copy constructor.

Member Function Documentation

◆ endProgress()

void endProgress ( ) const

◆ getLogType()

LogType getLogType ( ) const

Returns the type of progress log being used.

◆ logTypeToFactoryName_()

static String logTypeToFactoryName_ ( LogType  type)

Return the name of the factory product used for this log type.

◆ nextProgress()

void nextProgress ( ) const

increment progress by 1 (according to range begin-end)

◆ operator=()

ProgressLogger& operator= ( const ProgressLogger other)

Assignment Operator.

Referenced by SignalToNoiseEstimator< ContainerT >::operator=().

◆ setLogType()

void setLogType ( LogType  type) const

◆ setProgress()

void setProgress ( SignedSize  value) const

◆ startProgress()

void startProgress ( SignedSize  begin,
SignedSize  end,
const String label 
) const

Initializes the progress display.

Sets the progress range from begin to end. If begin equals end, setProgress only indicates that the program is still running, but without showing any absolute progress value.

Sets the label to label.

Make sure to call setLogType first!

Referenced by SpectraMerger::averageCentroidSpectra_(), GridBasedClustering< Metric >::cluster(), SignalToNoiseEstimatorMeanIterative< Container >::computeSTN_(), SignalToNoiseEstimatorMedian< ContainerT >::computeSTN_(), TOPPOpenSwathBase::loadTransitionList(), TOPPGNPSExport::main_(), and NucleicAcidSearchEngine::main_().

Member Data Documentation

◆ current_logger_

ProgressLoggerImpl* current_logger_

◆ last_invoke_

time_t last_invoke_

◆ recursion_depth_

int recursion_depth_

◆ type_

LogType type_