gatb.core-API-0.0.0
Progress Class Reference

Progress information display feature. More...

#include <Progress.hpp>

Inheritance diagram for Progress:
Inheritance graph

Public Member Functions

 Progress (u_int64_t ntasks, const char *msg, std::ostream &os=std::cerr)
 
virtual ~Progress ()
 
void init ()
 
void finish ()
 
void inc (u_int64_t ntasks_done)
 
void set (u_int64_t ntasks_done)
 
void reset (u_int64_t ntasks)
 
void setMessage (const std::string &msg)
 
- Public Member Functions inherited from IteratorListener
virtual ~IteratorListener ()
 
- Public Member Functions inherited from SmartPointer
void use ()
 
void forget ()
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 

Additional Inherited Members

- Protected Member Functions inherited from SmartPointer
 SmartPointer ()
 
virtual ~SmartPointer ()
 

Detailed Description

Progress information display feature.

This class is used to display some progression information, for instance during the iteration of an iterator.

It provides 3 methods that are supposed to be called by the progressing job:

  • init : called at the beginning of the job
  • finish : called at the end of the job
  • inc : called to notify some amount of job being done

It can be used as this by the SubjectIterator class that encapsulates an iterator and calls some functor for notifying progress information.

This implementation merely dumps '-' characters as progression goes on.

See also
gatb::tools::dp::impl::SubjectIterator

Constructor & Destructor Documentation

Progress ( u_int64_t  ntasks,
const char *  msg,
std::ostream &  os = std::cerr 
)

Constructor.

Parameters
[in]ntasks: nb of items to be processed
[in]msg: message to be displayed
[in]os: output stream where progress information is to be displayed
virtual ~Progress ( )
inlinevirtual

Destructor.

Member Function Documentation

void finish ( )
virtual

Finish the progress information.

Reimplemented from IteratorListener.

void inc ( u_int64_t  ntasks_done)
virtual

Increase the number of currently done tasks.

Parameters
[in]ntasks_done: amount of job done before previous call.

Reimplemented from IteratorListener.

void init ( )
virtual

Initialization of the object.

Reimplemented from IteratorListener.

Reimplemented in ProgressTimer.

void reset ( u_int64_t  ntasks)
virtual

We reinitialize the progress object.

Reimplemented from IteratorListener.

void set ( u_int64_t  ntasks_done)
virtual

Set the current number of tasks done.

Parameters
[in]ntasks_done: sets the current number of job done.

Reimplemented from IteratorListener.

void setMessage ( const std::string &  msg)
virtual

Associate a message to the listener.

Parameters
[in]msg: message to be set.

Reimplemented from IteratorListener.


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