SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
SourceXtractor::ProgressLogger Class Reference

#include <ProgressLogger.h>

Inheritance diagram for SourceXtractor::ProgressLogger:
Collaboration diagram for SourceXtractor::ProgressLogger:

Public Member Functions

virtual ~ProgressLogger ()=default
 ProgressLogger (const std::chrono::steady_clock::duration &min_interval)
void handleMessage (const std::list< ProgressInfo > &info) override
void handleMessage (const bool &done) override
Public Member Functions inherited from SourceXtractor::ProgressReporter
virtual ~ProgressReporter ()=default
 ProgressReporter ()=default
virtual void handleMessage (const std::list< ProgressInfo > &message)=0
virtual void handleMessage (const bool &message)=0
Public Member Functions inherited from SourceXtractor::Observer< std::list< ProgressInfo > >
virtual ~Observer ()=default
Public Member Functions inherited from SourceXtractor::Observer< bool >
virtual ~Observer ()=default

Protected Member Functions

void print ()

Protected Attributes

Elements::Logging m_logger
std::chrono::steady_clock::duration m_min_interval
std::chrono::steady_clock::time_point m_started
std::chrono::steady_clock::time_point m_last_logged
std::list< ProgressInfom_progress_info
std::atomic_bool m_done

Detailed Description

This concrete implementation of ProgressReporter relies on Element's logging. It only logs the progress if a minimum interval of time has passed since the las update.

Definition at line 38 of file ProgressLogger.h.

Constructor & Destructor Documentation

◆ ~ProgressLogger()

virtual SourceXtractor::ProgressLogger::~ProgressLogger ( )
virtualdefault

◆ ProgressLogger()

SourceXtractor::ProgressLogger::ProgressLogger ( const std::chrono::steady_clock::duration & min_interval)
explicit

Constructor

Parameters
min_intervalDo not log an update if less than min_interval has elapsed since the last logged update.

Definition at line 22 of file ProgressLogger.cpp.

References m_done, m_last_logged, m_logger, m_min_interval, and m_started.

Member Function Documentation

◆ handleMessage() [1/2]

void SourceXtractor::ProgressLogger::handleMessage ( const bool & done)
overridevirtual

Implements SourceXtractor::Observer< bool >.

Definition at line 63 of file ProgressLogger.cpp.

References m_done, and print().

Here is the call graph for this function:

◆ handleMessage() [2/2]

void SourceXtractor::ProgressLogger::handleMessage ( const std::list< ProgressInfo > & info)
overridevirtual

Implements SourceXtractor::Observer< std::list< ProgressInfo > >.

Definition at line 58 of file ProgressLogger.cpp.

References m_progress_info, and print().

Here is the call graph for this function:

◆ print()

void SourceXtractor::ProgressLogger::print ( )
protected

Member Data Documentation

◆ m_done

std::atomic_bool SourceXtractor::ProgressLogger::m_done
protected

Definition at line 58 of file ProgressLogger.h.

Referenced by handleMessage(), print(), and ProgressLogger().

◆ m_last_logged

std::chrono::steady_clock::time_point SourceXtractor::ProgressLogger::m_last_logged
protected

Definition at line 56 of file ProgressLogger.h.

Referenced by print(), and ProgressLogger().

◆ m_logger

Elements::Logging SourceXtractor::ProgressLogger::m_logger
protected

Definition at line 54 of file ProgressLogger.h.

Referenced by print(), and ProgressLogger().

◆ m_min_interval

std::chrono::steady_clock::duration SourceXtractor::ProgressLogger::m_min_interval
protected

Definition at line 55 of file ProgressLogger.h.

Referenced by print(), and ProgressLogger().

◆ m_progress_info

std::list<ProgressInfo> SourceXtractor::ProgressLogger::m_progress_info
protected

Definition at line 57 of file ProgressLogger.h.

Referenced by handleMessage(), and print().

◆ m_started

std::chrono::steady_clock::time_point SourceXtractor::ProgressLogger::m_started
protected

Definition at line 56 of file ProgressLogger.h.

Referenced by print(), and ProgressLogger().


The documentation for this class was generated from the following files: