CVR-Lib last update 20 Sep 2009

cvr::streamProgressInfo Class Reference

This class is a default implementation for the progress info interface. More...

#include <cvrStreamProgressInfo.h>

Inheritance diagram for cvr::streamProgressInfo:

Inheritance graph
[legend]
Collaboration diagram for cvr::streamProgressInfo:

Collaboration graph
[legend]

List of all members.

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 useStream (std::ostream &stream)
void setEndline (const std::string &endline)
virtual void step (const std::string &progressInfo)
virtual void substep (const int detail, const std::string &info)
streamProgressInfocopy (const streamProgressInfo &other)
streamProgressInfooperator= (const streamProgressInfo &other)
const std::string & name () const
virtual streamProgressInfoclone () const
virtual streamProgressInfonewInstance () const

Protected Attributes

std::ostream * out_
std::string endline_


Detailed Description

This class is a default implementation for the progress info interface.

It dumps the progress information to a std::ostream, or std::cout if you do not give one.


Constructor & Destructor Documentation

cvr::streamProgressInfo::streamProgressInfo ( const std::string &  title = "",
const int  maximumSteps = 100 
)

Default constructor.

Parameters:
title the name of the progressInfo object
maximumSteps the maximum number of steps of the process

cvr::streamProgressInfo::streamProgressInfo ( std::ostream &  outStream,
const std::string &  title = "",
const int  maximumSteps = 100 
)

Default constructor.

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

cvr::streamProgressInfo::streamProgressInfo ( const streamProgressInfo other  ) 

Copy constructor.

virtual cvr::streamProgressInfo::~streamProgressInfo (  )  [virtual]

Destructor.


Member Function Documentation

virtual streamProgressInfo* cvr::streamProgressInfo::clone (  )  const [virtual]

The clone member.

Implements cvr::progressInfo.

streamProgressInfo& cvr::streamProgressInfo::copy ( const streamProgressInfo other  ) 

The copy member.

const std::string& cvr::streamProgressInfo::name (  )  const [virtual]

Returns the name of the class.

Reimplemented from cvr::progressInfo.

virtual streamProgressInfo* cvr::streamProgressInfo::newInstance (  )  const [virtual]

The newInstance member.

Implements cvr::progressInfo.

streamProgressInfo& cvr::streamProgressInfo::operator= ( const streamProgressInfo other  ) 

alias for copy

void cvr::streamProgressInfo::setEndline ( const std::string &  endline  ) 

Set the endline string used.

The default is "\n".

virtual void cvr::streamProgressInfo::step ( const std::string &  progressInfo  )  [virtual]

Report one step done.

Parameters:
progressInfo string with some text information for the step

Implements cvr::progressInfo.

virtual void cvr::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.

Implements cvr::progressInfo.

virtual void cvr::streamProgressInfo::useStream ( std::ostream &  stream  )  [virtual]

Set a new stream.

The streamProgressInfo keeps a pointer to the stream.


Member Data Documentation

std::string cvr::streamProgressInfo::endline_ [protected]

The sequence that is used for end-of-line when emitting steps.

std::ostream* cvr::streamProgressInfo::out_ [protected]

Stream being used.


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

Generated on Sun Sep 20 22:08:41 2009 for CVR-Lib by Doxygen 1.5.8