LOOS  v2.3.2
loos::EstimatingCounter Class Reference

A progress counter that can estimate how much time is left. More...

#include <ProgressCounters.hpp>

Inheritance diagram for loos::EstimatingCounter:
Collaboration diagram for loos::EstimatingCounter:

Public Member Functions

 EstimatingCounter (const uint n)
 
void setExpected (uint)
 Alter the expected count.
 
uint remaining (void)
 Returns the number of iterations left.
 
double timeRemaining (void)
 
double fractionComplete (void)
 Returns the percent completed so far.
 
- Public Member Functions inherited from loos::SimpleCounter
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.
 

Protected Attributes

uint expected
 
- Protected Attributes inherited from loos::SimpleCounter
uint count_
 
Timer< WallTimertimer_
 
Observers observers
 

Detailed Description

A progress counter that can estimate how much time is left.

This class has to know the count of expected iterations so it can estimate how much time is left. It is assumed that the execution time per iteration is largely constant.

Definition at line 114 of file ProgressCounters.hpp.

Member Function Documentation

double loos::EstimatingCounter::timeRemaining ( void  )
virtual

Estimates the amount of time left using the current average time per iteration

Reimplemented from loos::SimpleCounter.

Definition at line 76 of file ProgressCounters.cpp.


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