SourceXtractorPlusPlus 1.0.3
SourceXtractor++, the next generation SExtractor
Loading...
Searching...
No Matches
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
31namespace SourceXtractor {
32
39public:
40 virtual ~ProgressLogger() = default;
41
47 explicit 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
53protected:
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
std::list< ProgressInfo > m_progress_info
std::chrono::steady_clock::time_point m_last_logged
ProgressLogger(const std::chrono::steady_clock::duration &min_interval)
void handleMessage(const std::list< ProgressInfo > &info) override
virtual ~ProgressLogger()=default
std::chrono::steady_clock::duration m_min_interval
std::chrono::steady_clock::time_point m_started