Public Member Functions | Protected Member Functions | Protected Attributes
mbl_progress_time Class Reference

Progress class that outputs elapsed time reporting on progress. More...

#include <mbl_progress_time.h>

Inheritance diagram for mbl_progress_time:
Inheritance graph
[legend]

List of all members.

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_

Detailed Description

Progress class that outputs elapsed time reporting on progress.

Definition at line 23 of file mbl_progress_time.h.


Constructor & Destructor Documentation

mbl_progress_time::mbl_progress_time ( vcl_ostream &  os = vcl_cout)

Constructor.

Parameters:
osOstream 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.


Member Function Documentation

vcl_string mbl_progress::display_text ( const vcl_string &  identifier) const [inherited]

Gets display text for given identifier.

Parameters:
identifierto 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.

Parameters:
identifierto query.
Returns:
progress (-1 if identifier is not known by this object).

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.

Parameters:
identifierProgress object to check.
Returns:
True if a cancel flag is set for this progress object.

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.

Parameters:
identifierThe 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.

Parameters:
identifierThe 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.

Parameters:
identifierThe operation being monitored.
progressThe 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.

Parameters:
identifierto query.
Returns:
progress (-i if identifier is not known by this object).

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.

Parameters:
identifierProgress 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.


Member Data Documentation

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.


The documentation for this class was generated from the following files: