geopm 3.2.1.dev270+g28d5c27cd
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
Public Member Functions | List of all members
geopm::LambdaSignal Class Reference
Inheritance diagram for geopm::LambdaSignal:
Inheritance graph
[legend]
Collaboration diagram for geopm::LambdaSignal:
Collaboration graph
[legend]

Public Member Functions

 LambdaSignal (std::function< double(void)> sample_fn, std::function< double(void)> read_fn)
 
void setup_batch (void) override
 Prepare the signal for being updated through side effects by the owner's read_batch step. This method should not fail if called multiple times, and ideally only apply the side effects on the first call.
 
double sample (void) override
 Apply any conversions necessary to interpret the latest stored value as a double.
 
double read (void) const override
 Read directly the value of the signal without affecting any pushed batch signals.
 
- Public Member Functions inherited from geopm::Signal
virtual ~Signal ()=default
 
virtual void set_sample (double)
 Set the value to be returned by sample()
 
virtual bool is_sampled (void) const
 True if the signal has been sampled during this batch.
 

Constructor & Destructor Documentation

◆ LambdaSignal()

geopm::LambdaSignal::LambdaSignal ( std::function< double(void)>  sample_fn,
std::function< double(void)>  read_fn 
)
inline

Member Function Documentation

◆ read()

double geopm::LambdaSignal::read ( void  ) const
inlineoverridevirtual

Read directly the value of the signal without affecting any pushed batch signals.

Implements geopm::Signal.

◆ sample()

double geopm::LambdaSignal::sample ( void  )
inlineoverridevirtual

Apply any conversions necessary to interpret the latest stored value as a double.

Implements geopm::Signal.

◆ setup_batch()

void geopm::LambdaSignal::setup_batch ( void  )
inlineoverridevirtual

Prepare the signal for being updated through side effects by the owner's read_batch step. This method should not fail if called multiple times, and ideally only apply the side effects on the first call.

Implements geopm::Signal.


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