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

Class to support a periodic wait loop. More...

#include <Waiter.hpp>

Inheritance diagram for geopm::Waiter:
Inheritance graph
[legend]

Public Member Functions

 Waiter ()=default
 
virtual ~Waiter ()=default
 
virtual void reset (void)=0
 Reset the timer for next wait. More...
 
virtual void reset (double period)=0
 Reset the timer for next wait and set period. More...
 
virtual void wait (void)=0
 Wait until the period has elapsed since last call to reset() or wait() More...
 
virtual double period (void) const =0
 Get the period for the waiter. More...
 

Static Public Member Functions

static std::unique_ptr< Waitermake_unique (double period)
 Create a Waiter with "sleep" strategy. More...
 
static std::unique_ptr< Waitermake_unique (double period, std::string strategy)
 Create a Waiter. More...
 

Detailed Description

Class to support a periodic wait loop.

Constructor & Destructor Documentation

◆ Waiter()

geopm::Waiter::Waiter ( )
default

◆ ~Waiter()

virtual geopm::Waiter::~Waiter ( )
virtualdefault

Member Function Documentation

◆ make_unique() [1/2]

std::unique_ptr< Waiter > geopm::Waiter::make_unique ( double  period)
static

Create a Waiter with "sleep" strategy.

Parameters
[in]periodDuration in seconds to wait

◆ make_unique() [2/2]

std::unique_ptr< Waiter > geopm::Waiter::make_unique ( double  period,
std::string  strategy 
)
static

Create a Waiter.

Parameters
[in]periodDuration in seconds to wait
[in]strategyWait algorithm ("sleep")

◆ period()

virtual double geopm::Waiter::period ( void  ) const
pure virtual

Get the period for the waiter.

Returns
The duration of the wait

Implemented in geopm::SleepWaiter.

◆ reset() [1/2]

virtual void geopm::Waiter::reset ( double  period)
pure virtual

Reset the timer for next wait and set period.

Parameters
[in]periodDuration in seconds to wait

Implemented in geopm::SleepWaiter.

◆ reset() [2/2]

virtual void geopm::Waiter::reset ( void  )
pure virtual

Reset the timer for next wait.

Implemented in geopm::SleepWaiter.

◆ wait()

virtual void geopm::Waiter::wait ( void  )
pure virtual

Wait until the period has elapsed since last call to reset() or wait()

Implemented in geopm::SleepWaiter.


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