A progress counter class. More...
#include <Progress.hpp>
Public Member Functions | |
ProgressCounter (int stepVal, string prefix="") | |
void | operator++ () |
Protected Member Functions | |
void | print_progress () |
Prints the current state. | |
Protected Attributes | |
string | m_prefix |
The prefix string. | |
size_t | m_stepVal |
The step value for output generation. | |
size_t | m_currentVal |
The current counter value. | |
boost::mutex | m_mutex |
A mutex object for counter increment (for parallel executions). | |
stringstream | m_stream |
A string stream for output generation. | |
string | m_fillstring |
A fill string for correct output alignment. |
A progress counter class.
This class can be used of the number of performed operations is not known in advance (e.g. ASCII file reading). After m_stepVal} operations the current counter is printed.
Definition at line 89 of file Progress.hpp.
lssr::ProgressCounter::ProgressCounter | ( | int | stepVal, | |
string | prefix = "" | |||
) |
Definition at line 49 of file Progress.cpp.
void lssr::ProgressCounter::operator++ | ( | ) |
void lssr::ProgressCounter::print_progress | ( | ) | [protected] |
Prints the current state.
Definition at line 66 of file Progress.cpp.
size_t lssr::ProgressCounter::m_currentVal [protected] |
The current counter value.
Definition at line 118 of file Progress.hpp.
string lssr::ProgressCounter::m_fillstring [protected] |
A fill string for correct output alignment.
Definition at line 127 of file Progress.hpp.
boost::mutex lssr::ProgressCounter::m_mutex [protected] |
A mutex object for counter increment (for parallel executions).
Definition at line 121 of file Progress.hpp.
string lssr::ProgressCounter::m_prefix [protected] |
The prefix string.
Definition at line 112 of file Progress.hpp.
size_t lssr::ProgressCounter::m_stepVal [protected] |
The step value for output generation.
Definition at line 115 of file Progress.hpp.
stringstream lssr::ProgressCounter::m_stream [protected] |
A string stream for output generation.
Definition at line 124 of file Progress.hpp.