SourceXtractorPlusPlus  0.8
Please provide a description of the project.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
ProgressLogger(const std::chrono::steady_clock::duration &min_interval)
std::chrono::steady_clock::time_point m_last_logged
virtual ~ProgressLogger()=default
STL class.
std::list< ProgressInfo > m_progress_info
void handleMessage(const std::list< ProgressInfo > &info) override
std::chrono::steady_clock::time_point m_started
std::chrono::steady_clock::duration m_min_interval