LOOS  v2.3.2
loos::SimpleCounter Class Reference

Basic progress counter object, defining the interface... More...

#include <ProgressCounters.hpp>

Inheritance diagram for loos::SimpleCounter:
Collaboration diagram for loos::SimpleCounter:

Public Member Functions

void attach (ObsT *)
 
void detach (ObsT *)
 
virtual void notify (void)
 Notify observers that an update should occur.
 
virtual void finish (void)
 Notify observers that we've finished with our calculation.
 
virtual void start (void)
 Notify observers that we're starting a calculation.
 
uint count (void) const
 Number of iterations we've seen so far.
 
virtual double elapsed (void)
 Total elapsed wall-time.
 
virtual uint remaining (void)
 Remaining iterations (if applicable)
 
virtual double timeRemaining (void)
 Remaining time (estimated, again if applicable)
 
virtual double fractionComplete (void)
 Percent complete (if applicable)
 

Protected Attributes

uint count_
 
Timer< WallTimertimer_
 
Observers observers
 

Detailed Description

Basic progress counter object, defining the interface...

The idea here is that SimpleCounter and its children are "observable" objects (a la the Observer pattern). The SimpleCounter handles the basic time-keeping functions and forwards messages along to its observers when certain events happen, such as starting, stopping, and updating. Not all functions are implemented though. For example, the SimpleTimer doesn't have an estimate for the total number of updates it will receive, so the estimating functions will throw an error.

This class is not actually meant to be used by itself, but via the aggregator ProgressCounter class defined later...

Definition at line 66 of file ProgressCounters.hpp.


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