latest version v1.9 - last update 10 Apr 2010 |
Progress Information to stream. More...
#include <ltiProgressInfo.h>
Public Member Functions | |
streamProgressInfo (const std::string &title="", const int &maximumSteps=100) | |
streamProgressInfo (std::ostream &outStream, const std::string &title="", const int &maximumSteps=100) | |
streamProgressInfo (const streamProgressInfo &other) | |
virtual | ~streamProgressInfo () |
virtual void | setTitle (const std::string &theTitle) |
virtual void | setMaxSteps (const int &maximalSteps) |
virtual void | step (const std::string &progressInfo) |
virtual void | substep (const int detail, const std::string &info) |
virtual void | reset () |
virtual streamProgressInfo & | copy (const streamProgressInfo &other) |
virtual progressInfo * | clone () const |
virtual bool | breakRequested () const |
Protected Attributes | |
int | maxSteps |
int | lastStep |
std::string | lastStepText |
std::string | title |
std::ostream * | out |
std::string | endline |
Progress Information to stream.
This is a simple implementation of the progressInfo concept. It dumps the progress information to a std::ostream, or std::cout if you do not give one.
lti::streamProgressInfo::streamProgressInfo | ( | const std::string & | title = "" , |
|
const int & | maximumSteps = 100 | |||
) |
Default constructor.
Redirect all information to the std::cout stream.
title | the name of the progressInfo object | |
maximumSteps | the maximum number of steps of the process |
lti::streamProgressInfo::streamProgressInfo | ( | std::ostream & | outStream, | |
const std::string & | title = "" , |
|||
const int & | maximumSteps = 100 | |||
) |
Constructor.
outStream | output stream, where the progress information will be written. | |
title | the name of the progressInfo object | |
maximumSteps | the maximum number of steps of the process |
lti::streamProgressInfo::streamProgressInfo | ( | const streamProgressInfo & | other | ) |
Copy constructor.
virtual lti::streamProgressInfo::~streamProgressInfo | ( | ) | [virtual] |
Destructor.
virtual bool lti::streamProgressInfo::breakRequested | ( | ) | const [virtual] |
Returns true if someone wants the caller of this progress info object to terminate.
Implements lti::progressInfo.
virtual progressInfo* lti::streamProgressInfo::clone | ( | ) | const [virtual] |
The clone member.
Implements lti::progressInfo.
virtual streamProgressInfo& lti::streamProgressInfo::copy | ( | const streamProgressInfo & | other | ) | [virtual] |
The copy member.
Reimplemented from lti::progressInfo.
virtual void lti::streamProgressInfo::reset | ( | ) | [virtual] |
Reset progress information.
Implements lti::progressInfo.
virtual void lti::streamProgressInfo::setMaxSteps | ( | const int & | maximalSteps | ) | [virtual] |
Maximal number of steps.
Implements lti::progressInfo.
virtual void lti::streamProgressInfo::setTitle | ( | const std::string & | theTitle | ) | [virtual] |
Set the title of the progress info block.
Implements lti::progressInfo.
virtual void lti::streamProgressInfo::step | ( | const std::string & | progressInfo | ) | [virtual] |
Report one step done.
progressInfo | string with some text information for the step |
Implements lti::progressInfo.
virtual void lti::streamProgressInfo::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.
Reimplemented from lti::progressInfo.
std::string lti::streamProgressInfo::endline [protected] |
The sequence that is used for end-of-line when emitting steps.
int lti::streamProgressInfo::lastStep [protected] |
Last processed step.
std::string lti::streamProgressInfo::lastStepText [protected] |
Text specified for the last step.
int lti::streamProgressInfo::maxSteps [protected] |
Maximum number of steps expected.
std::ostream* lti::streamProgressInfo::out [protected] |
Stream being used.
std::string lti::streamProgressInfo::title [protected] |
Title for this progress info.