last update 20 Sep 2009 |
#include <cvrProgressInfo.h>
Public Member Functions | |
progressInfo (const std::string &title="", const int maximumSteps=100) | |
progressInfo (const progressInfo &other) | |
virtual | ~progressInfo () |
virtual void | setTitle (const std::string &theTitle) |
virtual void | setMaxSteps (const int maximalSteps) |
virtual void | setDetailLevel (const int level) |
virtual int | getDetailLevel () const |
virtual void | step (const std::string &progressInfo)=0 |
virtual void | substep (const int detail, const std::string &info)=0 |
virtual void | reset () |
virtual bool | breakRequested () const |
progressInfo & | copy (const progressInfo &other) |
const std::string & | name () const |
virtual progressInfo * | clone () const =0 |
virtual progressInfo * | newInstance () const =0 |
Protected Attributes | |
std::string | title_ |
int | maxSteps_ |
int | detailLevel_ |
int | lastStep_ |
It is mostly used for classifiers, where training can take a long time.
cvr::progressInfo::progressInfo | ( | const std::string & | title = "" , |
|
const int | maximumSteps = 100 | |||
) |
Default constructor.
The default are empty title and 100 maximum steps. These are rarely the correct settings. For informative progress information set these values either with the constructor or the setMaximumSteps() and setTitle() functions.
title | the name of the progressInfo object | |
maximumSteps | the maximum number of steps of the process |
cvr::progressInfo::progressInfo | ( | const progressInfo & | other | ) |
Copy constructor.
virtual cvr::progressInfo::~progressInfo | ( | ) | [virtual] |
Destructor.
virtual bool cvr::progressInfo::breakRequested | ( | ) | const [virtual] |
Returns true if someone wants the caller of this progress info object to terminate.
This function is mostly useful for GUI progressInfo implementations.
This default implementation always returns false.
virtual progressInfo* cvr::progressInfo::clone | ( | ) | const [pure virtual] |
progressInfo& cvr::progressInfo::copy | ( | const progressInfo & | other | ) |
The copy member.
virtual int cvr::progressInfo::getDetailLevel | ( | ) | const [virtual] |
Return the used detail level of substep information.
const std::string& cvr::progressInfo::name | ( | ) | const [virtual] |
virtual progressInfo* cvr::progressInfo::newInstance | ( | ) | const [pure virtual] |
virtual void cvr::progressInfo::reset | ( | ) | [virtual] |
Reset progress information.
virtual void cvr::progressInfo::setDetailLevel | ( | const int | level | ) | [virtual] |
Detail level of substep information.
Level 1 is equal to that of normal steps.
virtual void cvr::progressInfo::setMaxSteps | ( | const int | maximalSteps | ) | [virtual] |
Maximal number of steps.
virtual void cvr::progressInfo::setTitle | ( | const std::string & | theTitle | ) | [virtual] |
Set the title of the progress info block.
virtual void cvr::progressInfo::step | ( | const std::string & | progressInfo | ) | [pure virtual] |
Report one step done.
progressInfo | string with some text information for the step |
Implemented in cvr::streamProgressInfo.
virtual void cvr::progressInfo::substep | ( | const int | detail, | |
const std::string & | info | |||
) | [pure virtual] |
Report additional information for a step, with the given detail level.
The given information will be displayed only if the current detail level is higher or equal than the detail specified in this method.
detail | is the detail level. The lowest (as in step()) is 1. | |
info | the string displayed for the substep |
Implemented in cvr::streamProgressInfo.
int cvr::progressInfo::detailLevel_ [protected] |
Detail level used for the substeps.
int cvr::progressInfo::lastStep_ [protected] |
Last processed step.
int cvr::progressInfo::maxSteps_ [protected] |
Maximum number of steps expected.
std::string cvr::progressInfo::title_ [protected] |
Title for this progress info.