A class that indicates the progress by a spinning cross. More...
#include <tpie/progress_indicator_spin.h>
Inherits tpie::progress_indicator_terminal.
Public Member Functions | |
progress_indicator_spin (const std::string &title, const std::string &description, stream_size_type minRange, stream_size_type maxRange, stream_size_type stepValue) | |
Initializes the indicator. More... | |
progress_indicator_spin (const progress_indicator_spin &other) | |
Copy-constructor. More... | |
progress_indicator_spin & | operator= (const progress_indicator_spin &other) |
Assignment operator. More... | |
virtual | ~progress_indicator_spin () |
The destructor. More... | |
virtual void | refresh () |
Display the indicator. More... | |
void | done () |
Advance the indicator to the end and print an (optional) message that is followed by a newline. More... | |
void | set_title (const std::string &title) |
Set the title of a new task to be monitored. 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) |
virtual void | init (stream_size_type range=0) |
Initialize progress indicator. More... | |
virtual void | set_range (stream_size_type range) |
Set the upper bound of the counting range. 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 Member Functions | |
void | display_percentage () |
Compute and print the percentage or step count. More... | |
Protected Attributes | |
char * | m_symbols |
The characters used for the spinning indicator. More... | |
unsigned short | m_numberOfStates |
The number of characters used for the spinning indicator. More... | |
unsigned short | m_state |
The current character used for the spinning indicator. More... | |
std::string | m_title |
A string holding the description of the title. More... | |
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... | |
A class that indicates the progress by a spinning cross.
Definition at line 41 of file progress_indicator_spin.h.
|
inline |
Initializes the indicator.
title | The title of the progress indicator. |
description | A text to be printed in front of the indicator. |
minRange | The lower bound of the range. |
maxRange | The upper bound of the range. |
stepValue | The increment for each step. |
Definition at line 58 of file progress_indicator_spin.h.
References m_numberOfStates, and m_symbols.
|
inline |
Copy-constructor.
Definition at line 78 of file progress_indicator_spin.h.
|
inlinevirtual |
The destructor.
Nothing is done.
Definition at line 109 of file progress_indicator_spin.h.
References m_symbols.
|
inlineprotectedinherited |
Compute and print the percentage or step count.
Definition at line 143 of file progress_indicator_terminal.h.
References tpie::progress_indicator_base::m_current, and tpie::progress_indicator_base::m_range.
Referenced by tpie::progress_indicator_terminal::refresh().
|
inlinevirtualinherited |
Advance the indicator to the end and print an (optional) message that is followed by a newline.
text | The message to be printed at the end of the indicator. |
Reimplemented from tpie::progress_indicator_base.
Definition at line 99 of file progress_indicator_terminal.h.
References tpie::progress_indicator_base::m_current, tpie::progress_indicator_base::m_range, and tpie::progress_indicator_terminal::refresh().
|
inlineinherited |
Get the current value of the step counter.
Definition at line 162 of file progress_indicator_base.h.
References tpie::progress_indicator_base::m_current.
Referenced by tpie::pipelining::bits::proxy_progress_indicator::refresh().
|
inlineinherited |
Get the maximum value of the current range.
Definition at line 167 of file progress_indicator_base.h.
References tpie::progress_indicator_base::m_range.
Referenced by tpie::pipelining::bits::proxy_progress_indicator::refresh().
|
inlinevirtualinherited |
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 124 of file progress_indicator_base.h.
References tpie::progress_indicator_base::m_current, tpie::progress_indicator_base::refresh(), and tpie::progress_indicator_base::set_range().
Referenced by tpie::merge_sorter< T, UseProgress, pred_t >::calc(), tpie::pipelining::passive_reverser< T >::source_t< dest_t >::go(), tpie::pipelining::serialization_bits::sort_calc_t< Traits >::go(), and tpie::parallel_sort().
|
inline |
Assignment operator.
Definition at line 87 of file progress_indicator_spin.h.
References m_numberOfStates, m_state, and m_symbols.
|
inlinevirtual |
Display the indicator.
Reimplemented from tpie::progress_indicator_terminal.
Definition at line 119 of file progress_indicator_spin.h.
References tpie::progress_indicator_base::m_current, m_numberOfStates, m_state, and m_symbols.
|
inlinevirtualinherited |
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 150 of file progress_indicator_base.h.
References tpie::progress_indicator_base::m_range.
Referenced by tpie::progress_indicator_base::init().
|
inlineinherited |
Set the title of a new task to be monitored.
The terminal line will be newline'd, and the title will be followed by a newline as well.
title | The title of the new task to be monitored. |
Definition at line 116 of file progress_indicator_terminal.h.
References tpie::progress_indicator_terminal::m_title.
|
inlineinherited |
Record an increment to the indicator and advance the indicator.
Definition at line 89 of file progress_indicator_base.h.
References tpie::log_debug(), tpie::progress_indicator_base::m_current, and tpie::progress_indicator_base::refresh().
Referenced by tpie::merge_sorter< T, UseProgress, pred_t >::calc(), tpie::pipelining::passive_reverser< T >::source_t< dest_t >::go(), tpie::pipelining::serialization_bits::sort_calc_t< Traits >::go(), tpie::ami::Internal_Sorter_Obj< T, Compare >::sort(), and tpie::pipelining::node::step().
|
protectedinherited |
The current progress count [m_minRange...m_maxRange].
Definition at line 184 of file progress_indicator_base.h.
Referenced by tpie::progress_indicator_terminal::display_percentage(), tpie::progress_indicator_terminal::done(), tpie::progress_indicator_base::get_current(), tpie::progress_indicator_base::init(), tpie::progress_indicator_arrow::refresh(), refresh(), tpie::progress_indicator_arrow::reset(), and tpie::progress_indicator_base::step().
|
protected |
The number of characters used for the spinning indicator.
Definition at line 135 of file progress_indicator_spin.h.
Referenced by operator=(), progress_indicator_spin(), and refresh().
|
protectedinherited |
The upper bound of the counting range.
Definition at line 181 of file progress_indicator_base.h.
Referenced by tpie::progress_indicator_terminal::display_percentage(), tpie::progress_indicator_terminal::done(), tpie::progress_indicator_base::get_range(), tpie::progress_indicator_arrow::refresh(), and tpie::progress_indicator_base::set_range().
|
protected |
The current character used for the spinning indicator.
Definition at line 138 of file progress_indicator_spin.h.
Referenced by operator=(), and refresh().
|
protected |
The characters used for the spinning indicator.
Definition at line 132 of file progress_indicator_spin.h.
Referenced by operator=(), progress_indicator_spin(), refresh(), and ~progress_indicator_spin().
|
protectedinherited |
A string holding the description of the title.
Definition at line 159 of file progress_indicator_terminal.h.
Referenced by tpie::progress_indicator_arrow::refresh(), tpie::progress_indicator_terminal::refresh(), and tpie::progress_indicator_terminal::set_title().