SourceXtractorPlusPlus  0.10
Please provide a description of the project.
ProgressLogger.h
Go to the documentation of this file.
1 
17 /*
18  * ProgressLogger.h
19  *
20  * Created on: Mar 19, 2019
21  * Author: Alejandro Alvarez Ayllon
22  */
23 
24 #ifndef _SEMAIN_PROGRESSLOGGER_H
25 #define _SEMAIN_PROGRESSLOGGER_H
26 
28 #include <ElementsKernel/Logging.h>
29 #include <chrono>
30 
31 namespace SourceXtractor {
32 
39 public:
40  virtual ~ProgressLogger() = default;
41 
47  ProgressLogger(const std::chrono::steady_clock::duration& min_interval);
48 
49  void handleMessage(const std::list<ProgressInfo>& info) override;
50 
51  void handleMessage(const bool& done) override;
52 
53 protected:
55  std::chrono::steady_clock::duration m_min_interval;
56  std::chrono::steady_clock::time_point m_started, m_last_logged;
58  std::atomic_bool m_done;
59 
60  void print();
61 };
62 
63 } // end SourceXtractor
64 
65 #endif // _SEMAIN_PROGRESSLOGGER_H
SourceXtractor::ProgressLogger::m_min_interval
std::chrono::steady_clock::duration m_min_interval
Definition: ProgressLogger.h:55
std::list
STL class.
SourceXtractor::ProgressLogger::m_logger
Elements::Logging m_logger
Definition: ProgressLogger.h:54
SourceXtractor::ProgressLogger::m_done
std::atomic_bool m_done
Definition: ProgressLogger.h:58
Elements::Logging
SourceXtractor::ProgressLogger::handleMessage
void handleMessage(const std::list< ProgressInfo > &info) override
Definition: ProgressLogger.cpp:58
SourceXtractor::ProgressLogger::print
void print()
Definition: ProgressLogger.cpp:28
SourceXtractor::ProgressLogger::ProgressLogger
ProgressLogger(const std::chrono::steady_clock::duration &min_interval)
Definition: ProgressLogger.cpp:22
SourceXtractor
Definition: Aperture.h:30
SourceXtractor::ProgressLogger::m_last_logged
std::chrono::steady_clock::time_point m_last_logged
Definition: ProgressLogger.h:56
ProgressReporter.h
SourceXtractor::ProgressReporter
Definition: ProgressReporter.h:43
SourceXtractor::ProgressLogger
Definition: ProgressLogger.h:38
Logging.h
SourceXtractor::ProgressLogger::m_progress_info
std::list< ProgressInfo > m_progress_info
Definition: ProgressLogger.h:57
SourceXtractor::ProgressLogger::m_started
std::chrono::steady_clock::time_point m_started
Definition: ProgressLogger.h:56
SourceXtractor::ProgressLogger::~ProgressLogger
virtual ~ProgressLogger()=default