geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
Signal.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015 - 2024 Intel Corporation
3  * SPDX-License-Identifier: BSD-3-Clause
4  */
5 
6 #ifndef SIGNAL_HPP_INCLUDE
7 #define SIGNAL_HPP_INCLUDE
8 
9 namespace geopm
10 {
15  class Signal
16  {
17  public:
18  virtual ~Signal() = default;
24  virtual void setup_batch(void) = 0;
27  virtual double sample(void) = 0;
30  virtual double read(void) const = 0;
32  virtual void set_sample(double) {};
34  virtual bool is_sampled(void) const {return false;};
35  };
36 }
37 
38 #endif
Definition: Signal.hpp:16
virtual ~Signal()=default
virtual bool is_sampled(void) const
True if the signal has been sampled during this batch.
Definition: Signal.hpp:34
virtual double read(void) const =0
Read directly the value of the signal without affecting any pushed batch signals.
virtual void setup_batch(void)=0
Prepare the signal for being updated through side effects by the owner's read_batch step....
virtual void set_sample(double)
Set the value to be returned by sample()
Definition: Signal.hpp:32
virtual double sample(void)=0
Apply any conversions necessary to interpret the latest stored value as a double.
Definition: Agg.cpp:20