LOOS 4.1.0
The Lightweight Object Oriented Structural analysis library/toolkit
Loading...
Searching...
No Matches
Public Member Functions | List of all members
loos::ProgressCounter< Trigger, Counter > Class Template Reference

The progress counter front-end. More...

#include <ProgressCounters.hpp>

Inheritance diagram for loos::ProgressCounter< Trigger, Counter >:
Inheritance graph
[legend]
Collaboration diagram for loos::ProgressCounter< Trigger, Counter >:
Collaboration graph
[legend]

Public Member Functions

 ProgressCounter (const Trigger &t)
 
 ProgressCounter (const Trigger &t, const Counter &c)
 
void setTrigger (const Trigger &t)
 Change the trigger.
 
void update (void)
 
- 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.
 
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)
 

Additional Inherited Members

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

Detailed Description

template<class Trigger = TriggerAlways, class Counter = SimpleCounter>
class loos::ProgressCounter< Trigger, Counter >

The progress counter front-end.

This class combines a counter with a trigger. You can pick whether or not you use a simple counter or an estimating counter, for example, and then combine that with a criterion for firing off a message to any observers that they need to update their display/output. The trigger is just a functor that returns a true value if the update notification should be sent, or a false if not.

Member Function Documentation

◆ update()

template<class Trigger = TriggerAlways, class Counter = SimpleCounter>
void loos::ProgressCounter< Trigger, Counter >::update ( void )
inline

Update the number of iterations and decide whether or not to notify based on the trigger policy


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