The base class for indicating the progress of some task. More...
#include <tpie/progress_indicator_base.h>
Inherited by tpie::pipelining::bits::proxy_progress_indicator, tpie::progress_indicator_null, tpie::progress_indicator_subindicator, and tpie::progress_indicator_terminal.
Public Member Functions | |
progress_indicator_base (stream_size_type range) | |
Initializes the indicator. More... | |
virtual | ~progress_indicator_base () |
Destructor. More... | |
progress_indicator_base (progress_indicator_base &&o) | |
progress_indicator_base & | operator= (progress_indicator_base &&o) |
progress_indicator_base ()=delete | |
Deleted default constructor. More... | |
progress_indicator_base (const progress_indicator_base &)=delete | |
Deleted copy constructor. More... | |
progress_indicator_base & | operator= (const progress_indicator_base &)=delete |
Deleted assignment operator. More... | |
void | step (stream_size_type step=1) |
Record an increment to the indicator and advance the indicator. More... | |
void | raw_step (stream_size_type step) |
Internal method used in fractional progress. More... | |
virtual void | init (stream_size_type range=0) |
Initialize progress indicator. More... | |
virtual void | done () |
Advance the indicator to the end. More... | |
virtual void | set_range (stream_size_type range) |
Set the upper bound of the counting range. More... | |
virtual void | refresh ()=0 |
Display the indicator. More... | |
stream_size_type | get_current () |
Get the current value of the step counter. More... | |
stream_size_type | get_range () |
Get the maximum value of the current range. More... | |
execution_time_predictor * | get_time_predictor () |
void | set_time_predictor (execution_time_predictor *p) |
std::string | estimated_remaining_time () |
virtual void | push_breadcrumb (const char *, description_importance) |
virtual void | pop_breadcrumb () |
Protected Attributes | |
stream_size_type | m_range |
The upper bound of the counting range. More... | |
stream_size_type | m_current |
The current progress count [m_minRange...m_maxRange]. More... | |
The base class for indicating the progress of some task.
At times, especially when processing large data sets, the user might want the program to provide information about how much progress has been made. TPIE provides a class hierarchy with an abstract base class progress_indicator_base for realizing such indicators. TPIE offers terminal-based indicators, such as progress_indicator_arrow that shows an extending arrow or progress_indicator_spin that shows a spinning "wheel". To allow for other types of indicators such as graphics-based indicators for (interfaces to) indicators provided by other APIs, the terminal-based indicators inherit from progress_indicator_terminal which in turn inherits from progress_indicator_base. To include other types of non-terminal-based indicators, the user thus should subclass progress_indicator_base. All indicators are based upon the following concept: The indicator is given a range [minRange , maxRange ] and a parameter stepValue/ For each update to the indicator and starting at minRange , the progress status will be advanced by stepValue units.
Definition at line 61 of file progress_indicator_base.h.
tpie::progress_indicator_base::progress_indicator_base | ( | stream_size_type | range | ) |
Initializes the indicator.
range | The upper bound of the counting range. |
|
virtual |
Destructor.
|
delete |
Deleted default constructor.
|
delete |
Deleted copy constructor.
|
inlinevirtual |
Advance the indicator to the end.
Reimplemented in tpie::progress_indicator_terminal, tpie::fractional_subindicator, tpie::progress_indicator_null, and tpie::progress_indicator_subindicator.
Definition at line 129 of file progress_indicator_base.h.
Referenced by tpie::merge_sorter< T, UseProgress, pred_t, store_t >::calc(), tpie::pipelining::serialization_bits::sort_calc_t< Traits >::go(), and tpie::parallel_sort().
|
inline |
Get the current value of the step counter.
Definition at line 151 of file progress_indicator_base.h.
References m_current.
|
inline |
Get the maximum value of the current range.
Definition at line 156 of file progress_indicator_base.h.
References m_range.
|
inlinevirtual |
Initialize progress indicator.
range | The number of times step() is going to be called. |
Reimplemented in tpie::fractional_subindicator, tpie::progress_indicator_null, and tpie::progress_indicator_subindicator.
Definition at line 120 of file progress_indicator_base.h.
References m_current, and set_range().
Referenced by tpie::merge_sorter< T, UseProgress, pred_t, store_t >::calc(), tpie::pipelining::serialization_bits::sort_calc_t< Traits >::go(), and tpie::parallel_sort().
|
delete |
Deleted assignment operator.
|
inline |
Internal method used in fractional progress.
In a hierarchy of fractional progress subindicators, only the lowest level of indicators should determine how many steps should pass until the next call to refresh(). When this happens, the subindicator calls raw_step() on its parent indicator rather than step(), which will short-circuit the logic and call the virtual method refresh() directly. You should probably not use this method; use step() instead.
Definition at line 110 of file progress_indicator_base.h.
References m_current, refresh(), and step().
|
pure virtual |
Display the indicator.
Implemented in tpie::progress_indicator_terminal, tpie::progress_indicator_spin, tpie::progress_indicator_arrow, tpie::progress_indicator_null, tpie::pipelining::bits::proxy_progress_indicator, and tpie::progress_indicator_subindicator.
Referenced by raw_step().
|
inlinevirtual |
Set the upper bound of the counting range.
This method also implies a reset of the counter. In order to be able to set the uper bound independent of setting the lower bound, no range checking is done.
range | The new upper bound. |
Reimplemented in tpie::progress_indicator_null.
Definition at line 139 of file progress_indicator_base.h.
References m_range.
Referenced by init().
|
inline |
Record an increment to the indicator and advance the indicator.
Definition at line 90 of file progress_indicator_base.h.
References m_current.
Referenced by tpie::merge_sorter< T, UseProgress, pred_t, store_t >::calc(), tpie::pipelining::serialization_bits::sort_calc_t< Traits >::go(), raw_step(), tpie::ami::Internal_Sorter_Obj< T, Compare >::sort(), and tpie::pipelining::node::step().
|
protected |
The current progress count [m_minRange...m_maxRange].
Definition at line 173 of file progress_indicator_base.h.
Referenced by tpie::progress_indicator_terminal::display_percentage(), tpie::progress_indicator_terminal::done(), get_current(), init(), raw_step(), tpie::progress_indicator_arrow::refresh(), tpie::progress_indicator_spin::refresh(), tpie::progress_indicator_arrow::reset(), and step().
|
protected |
The upper bound of the counting range.
Definition at line 170 of file progress_indicator_base.h.
Referenced by tpie::progress_indicator_terminal::display_percentage(), tpie::progress_indicator_terminal::done(), get_range(), tpie::progress_indicator_arrow::refresh(), and set_range().