geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::SumAccumulatorImp Class Reference

#include <Accumulator.hpp>

Inheritance diagram for geopm::SumAccumulatorImp:
Inheritance graph
[legend]
Collaboration diagram for geopm::SumAccumulatorImp:
Collaboration graph
[legend]

Public Member Functions

 SumAccumulatorImp ()
 
virtual ~SumAccumulatorImp ()=default
 
void update (double delta_signal) override
 Called in control loop to update state. More...
 
void enter (void) override
 Mark the beginning of an interval. More...
 
void exit (void) override
 Mark the end of an interval. More...
 
double total (void) const override
 Total increase of tracked signal when condition is true. More...
 
double interval_total (void) const override
 Increase of tracked signal over last interval. More...
 
- Public Member Functions inherited from geopm::SumAccumulator
virtual ~SumAccumulator ()=default
 Virtual destructor. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::SumAccumulator
static std::unique_ptr< SumAccumulatormake_unique (void)
 Factory constructor. More...
 
- Protected Member Functions inherited from geopm::SumAccumulator
 SumAccumulator ()=default
 

Constructor & Destructor Documentation

◆ SumAccumulatorImp()

geopm::SumAccumulatorImp::SumAccumulatorImp ( )

◆ ~SumAccumulatorImp()

virtual geopm::SumAccumulatorImp::~SumAccumulatorImp ( )
virtualdefault

Member Function Documentation

◆ enter()

void geopm::SumAccumulatorImp::enter ( void  )
overridevirtual

Mark the beginning of an interval.

Used to mark the beginning of an interval used for the interval_total() reporting. The next call to exit() will close the interval and update the value returned by interval_total() to reflect the interval between the enter() and exit() calls.

Implements geopm::SumAccumulator.

◆ exit()

void geopm::SumAccumulatorImp::exit ( void  )
overridevirtual

Mark the end of an interval.

Used to mark the end of an interval that was previously started with a call to the enter() API. The call to exit() will update the value returned by interval_total() to reflect the interval since the enter() call.

Implements geopm::SumAccumulator.

◆ interval_total()

double geopm::SumAccumulatorImp::interval_total ( void  ) const
overridevirtual

Increase of tracked signal over last interval.

Get the increase in the signal while the condition is true over the last interval. An interval is defined by an enter() and exit() call.

Returns
Sum of all values passed to update() during last interval.

Implements geopm::SumAccumulator.

◆ total()

double geopm::SumAccumulatorImp::total ( void  ) const
overridevirtual

Total increase of tracked signal when condition is true.

Used to report on the total accumulated sum of all of the updates since the construction of the object.

Returns
Sum of all values passed to update()

Implements geopm::SumAccumulator.

◆ update()

void geopm::SumAccumulatorImp::update ( double  delta_signal)
overridevirtual

Called in control loop to update state.

Update with the change in the signal being tracked for the sample. This is called once in each control interval where the condition is true. The change in the signal is measured over the period of the last control interval.

Parameters
[in]delta_signalChange in the signal over the control interval.

Implements geopm::SumAccumulator.


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