geopm  3.1.1.dev296+g5916b956
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::SleepWaiter Class Reference

Class to support a periodic wait loop based on clock_nanosleep() using CLOCK_REALTIME. More...

#include <Waiter.hpp>

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

Public Member Functions

 SleepWaiter (double period)
 
virtual ~SleepWaiter ()=default
 
void reset (void) override
 Reset the timer for next wait. More...
 
void reset (double period) override
 Reset the timer for next wait and set period. More...
 
void wait (void) override
 Wait until the period has elapsed since last call to reset() or wait() More...
 
double period (void) const override
 Get the period for the waiter. More...
 
- Public Member Functions inherited from geopm::Waiter
 Waiter ()=default
 
virtual ~Waiter ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from geopm::Waiter
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 based on clock_nanosleep() using CLOCK_REALTIME.

Constructor & Destructor Documentation

◆ SleepWaiter()

geopm::SleepWaiter::SleepWaiter ( double  period)

◆ ~SleepWaiter()

virtual geopm::SleepWaiter::~SleepWaiter ( )
virtualdefault

Member Function Documentation

◆ period()

double geopm::SleepWaiter::period ( void  ) const
overridevirtual

Get the period for the waiter.

Returns
The duration of the wait

Implements geopm::Waiter.

◆ reset() [1/2]

void geopm::SleepWaiter::reset ( double  period)
overridevirtual

Reset the timer for next wait and set period.

Parameters
[in]periodDuration in seconds to wait

Implements geopm::Waiter.

◆ reset() [2/2]

void geopm::SleepWaiter::reset ( void  )
overridevirtual

Reset the timer for next wait.

Implements geopm::Waiter.

◆ wait()

void geopm::SleepWaiter::wait ( void  )
overridevirtual

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

Implements geopm::Waiter.


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