Progress class that outputs elapsed time reporting on progress. More...
#include <mbl_progress_time.h>
Public Member Functions | |
mbl_progress_time (vcl_ostream &os=vcl_cout) | |
Constructor. | |
~mbl_progress_time () | |
Destructor. | |
virtual vcl_string | is_a () const |
Name of the class. | |
void | set_estimated_iterations (const vcl_string &identifier, const int iterations, const vcl_string &display_text) |
Estimated number of iterations for the given identifier. | |
void | set_throw_exception_on_cancel (bool t) |
If true set_progress() will throw an exception if cancel has been set. | |
void | set_progress (const vcl_string &identifier, const int progress) |
Sets progress for the given identifier. | |
void | increment_progress (const vcl_string &identifier, const int n=1) |
Increments progress for the given identifier by n. | |
void | end_progress (const vcl_string &identifier) |
Explicitly marks the end of loop for the given identifier. | |
int | progress (const vcl_string &identifier) const |
Gets progress for given identifier. | |
vcl_string | display_text (const vcl_string &identifier) const |
Gets display text for given identifier. | |
int | estimated_iterations (const vcl_string &identifier) const |
Gets estimated total iterations for given identifier. | |
void | set_cancelled (const vcl_string &identifier, const bool cancel) |
Modify the flag to cancel the current process. | |
bool | is_cancelled (const vcl_string &identifier) const |
Check whether progress object is marked as cancelled. | |
Protected Member Functions | |
virtual void | on_set_estimated_iterations (const vcl_string &identifier, const int total_iterations) |
Called when set_estimate_iterations() is called for a given identifier. | |
virtual void | on_set_progress (const vcl_string &identifier, const int progress) |
Called when set_progress() is called for a given identifier. | |
virtual void | on_end_progress (const vcl_string &identifier) |
Called when end_progress() is called for a given identifier. | |
Protected Attributes | |
vcl_ostream & | os_ |
vul_timer | timer_ |
vul_ios_state_saver | ios_state_ |
Progress class that outputs elapsed time reporting on progress.
Definition at line 23 of file mbl_progress_time.h.
mbl_progress_time::mbl_progress_time | ( | vcl_ostream & | os = vcl_cout | ) |
Constructor.
os | Ostream for text output (defaults to cout) |
Definition at line 17 of file mbl_progress_time.cxx.
mbl_progress_time::~mbl_progress_time | ( | ) |
Destructor.
Definition at line 28 of file mbl_progress_time.cxx.
vcl_string mbl_progress::display_text | ( | const vcl_string & | identifier | ) | const [inherited] |
Gets display text for given identifier.
identifier | to query. |
Definition at line 83 of file mbl_progress.cxx.
void mbl_progress::end_progress | ( | const vcl_string & | identifier | ) | [inherited] |
Explicitly marks the end of loop for the given identifier.
Definition at line 62 of file mbl_progress.cxx.
int mbl_progress::estimated_iterations | ( | const vcl_string & | identifier | ) | const [inherited] |
Gets estimated total iterations for given identifier.
identifier | to query. |
Definition at line 97 of file mbl_progress.cxx.
void mbl_progress::increment_progress | ( | const vcl_string & | identifier, |
const int | n = 1 |
||
) | [inherited] |
Increments progress for the given identifier by n.
Definition at line 48 of file mbl_progress.cxx.
vcl_string mbl_progress_time::is_a | ( | ) | const [virtual] |
Name of the class.
Definition at line 36 of file mbl_progress_time.cxx.
bool mbl_progress::is_cancelled | ( | const vcl_string & | identifier | ) | const [inherited] |
Check whether progress object is marked as cancelled.
identifier | Progress object to check. |
Definition at line 130 of file mbl_progress.cxx.
void mbl_progress_time::on_end_progress | ( | const vcl_string & | identifier | ) | [protected, virtual] |
Called when end_progress() is called for a given identifier.
identifier | The operation being monitored. |
Implements mbl_progress.
Definition at line 67 of file mbl_progress_time.cxx.
void mbl_progress_time::on_set_estimated_iterations | ( | const vcl_string & | identifier, |
const int | total_iterations | ||
) | [protected, virtual] |
Called when set_estimate_iterations() is called for a given identifier.
identifier | The operation being monitored. |
Implements mbl_progress.
Definition at line 45 of file mbl_progress_time.cxx.
void mbl_progress_time::on_set_progress | ( | const vcl_string & | identifier, |
const int | progress | ||
) | [protected, virtual] |
Called when set_progress() is called for a given identifier.
identifier | The operation being monitored. |
progress | The new progress status. |
Implements mbl_progress.
Definition at line 56 of file mbl_progress_time.cxx.
int mbl_progress::progress | ( | const vcl_string & | identifier | ) | const [inherited] |
Gets progress for given identifier.
identifier | to query. |
Definition at line 69 of file mbl_progress.cxx.
void mbl_progress::set_cancelled | ( | const vcl_string & | identifier, |
const bool | cancel | ||
) | [inherited] |
Modify the flag to cancel the current process.
identifier | Progress object to cancel. |
Definition at line 114 of file mbl_progress.cxx.
void mbl_progress::set_estimated_iterations | ( | const vcl_string & | identifier, |
const int | iterations, | ||
const vcl_string & | display_text | ||
) | [inherited] |
Estimated number of iterations for the given identifier.
Definition at line 11 of file mbl_progress.cxx.
void mbl_progress::set_progress | ( | const vcl_string & | identifier, |
const int | progress | ||
) | [inherited] |
Sets progress for the given identifier.
Checks whether cancel has been set; if so calls end_progress(), and throws an exception if "throw_exception_on_cancel" is true.
Definition at line 24 of file mbl_progress.cxx.
void mbl_progress::set_throw_exception_on_cancel | ( | bool | t | ) | [inline, inherited] |
If true set_progress() will throw an exception if cancel has been set.
Definition at line 64 of file mbl_progress.h.
vul_ios_state_saver mbl_progress_time::ios_state_ [protected] |
Definition at line 60 of file mbl_progress_time.h.
vcl_ostream& mbl_progress_time::os_ [protected] |
Definition at line 58 of file mbl_progress_time.h.
vul_timer mbl_progress_time::timer_ [protected] |
Definition at line 59 of file mbl_progress_time.h.