latest version v1.9 - last update 10 Apr 2010 |
Progress information interface. More...
#include <ltiProgressInfo.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)=0 |
virtual void | setMaxSteps (const int &maximalSteps)=0 |
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) |
virtual void | reset ()=0 |
virtual bool | breakRequested () const =0 |
progressInfo & | copy (const progressInfo &other) |
virtual progressInfo * | clone () const =0 |
Protected Attributes | |
int | detailLevel |
Progress information interface.
This virtual class is the parent of all classes that can be used to display the progress of processes that may take long times, which include classifiers, evaluation methods, etc.
The interface is simple and involves a concept where you have:
A simple example class that only redirects the information to the std::cout (or other std::ostream) is streamProgressInfo.
lti::progressInfo::progressInfo | ( | const std::string & | title = "" , |
|
const int & | maximumSteps = 100 | |||
) |
Default constructor.
title | the name of the progressInfo object | |
maximumSteps | the maximum number of steps of the process |
lti::progressInfo::progressInfo | ( | const progressInfo & | other | ) |
Copy constructor.
virtual lti::progressInfo::~progressInfo | ( | ) | [virtual] |
Destructor.
virtual bool lti::progressInfo::breakRequested | ( | ) | const [pure virtual] |
Returns true if someone wants the caller of this progress info object to terminate.
Implemented in lti::streamProgressInfo.
virtual progressInfo* lti::progressInfo::clone | ( | ) | const [pure virtual] |
The clone member.
Implemented in lti::streamProgressInfo.
progressInfo& lti::progressInfo::copy | ( | const progressInfo & | other | ) |
The copy member.
Reimplemented in lti::streamProgressInfo.
virtual int lti::progressInfo::getDetailLevel | ( | ) | const [virtual] |
Return the used detail level of substep information.
virtual void lti::progressInfo::reset | ( | ) | [pure virtual] |
Reset progress information.
Implemented in lti::streamProgressInfo.
virtual void lti::progressInfo::setDetailLevel | ( | const int | level | ) | [virtual] |
Detail level of substep information.
virtual void lti::progressInfo::setMaxSteps | ( | const int & | maximalSteps | ) | [pure virtual] |
Maximal number of steps.
Implemented in lti::streamProgressInfo.
virtual void lti::progressInfo::setTitle | ( | const std::string & | theTitle | ) | [pure virtual] |
Set the title of the progress info block.
Implemented in lti::streamProgressInfo.
virtual void lti::progressInfo::step | ( | const std::string & | progressInfo | ) | [pure virtual] |
Report one step done.
progressInfo | string with some text information for the step |
Implemented in lti::streamProgressInfo.
virtual void lti::progressInfo::substep | ( | const int | detail, | |
const std::string & | info | |||
) | [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.
The default implementation is void.
Reimplemented in lti::streamProgressInfo.
int lti::progressInfo::detailLevel [protected] |
Detail level used for the substeps.