SourceXtractorPlusPlus  0.13
Please provide a description of the project.
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
SourceXtractor::ProgressLogger Class Reference

#include <ProgressLogger.h>

Inheritance diagram for SourceXtractor::ProgressLogger:
[legend]
Collaboration diagram for SourceXtractor::ProgressLogger:
[legend]

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 T &message)=0
 
virtual void handleMessage (const T &message)=0
 
- Public Member Functions inherited from SourceXtractor::Observer< T >
virtual ~Observer ()=default
 
virtual void handleMessage (const T &message)=0
 

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)

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 Elements::Logging::getLogger().

Here is the call graph for this function:

Member Function Documentation

◆ handleMessage() [1/2]

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

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)
override

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

Definition at line 28 of file ProgressLogger.cpp.

References std::fixed(), Elements::Logging::info(), m, m_done, m_last_logged, m_logger, m_min_interval, m_progress_info, m_started, std::chrono::steady_clock::now(), s, std::setfill(), std::setprecision(), and std::setw().

Referenced by handleMessage().

Here is the call graph for this function:

Member Data Documentation

◆ m_done

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

Definition at line 58 of file ProgressLogger.h.

Referenced by handleMessage(), and print().

◆ 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().

◆ m_logger

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

Definition at line 54 of file ProgressLogger.h.

Referenced by print().

◆ 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().

◆ 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().


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