1#ifndef BKCRACK_PROGRESS_HPP
2#define BKCRACK_PROGRESS_HPP
29 template <std::invocable<std::ostream&> F>
32 const auto lock = std::scoped_lock{m_os_mutex};
42 virtual void beforeLog(std::ostream&) {}
44 std::mutex m_os_mutex;
std::atomic< int > done
Number of steps already done.
Definition Progress.hpp:38
std::atomic< State > state
State of the long operation.
Definition Progress.hpp:37
void log(F f)
Definition Progress.hpp:30
virtual ~Progress()=default
Destructor.
std::atomic< int > total
Total number of steps.
Definition Progress.hpp:39
State
Possible states of a long operation.
Definition Progress.hpp:15
@ Normal
The operation is ongoing or is fully completed.
Definition Progress.hpp:16
Progress(std::ostream &os)
Constructor.