geopm  3.1.1.dev272+gdfb40a8d
GEOPM - Global Extensible Open Power Manager
MultiplicationSignal.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 MULTIPLICATIONSIGNAL_HPP_INCLUDE
7 #define MULTIPLICATIONSIGNAL_HPP_INCLUDE
8 
9 #include <memory>
10 
11 #include "Signal.hpp"
12 
13 namespace geopm
14 {
18  {
19  public:
20  MultiplicationSignal(std::shared_ptr<Signal> multiplier,
21  double multiplicand);
24  virtual ~MultiplicationSignal() = default;
25  void setup_batch(void) override;
26  double sample(void) override;
27  double read(void) const override;
28  private:
29  std::shared_ptr<Signal> m_multiplier;
30  double m_multiplicand;
31  bool m_is_batch_ready;
32  };
33 }
34 
35 #endif
A composite signal used by an IOGroup to produce a signal as the Multiplication of one signal and a d...
Definition: MultiplicationSignal.hpp:18
double read(void) const override
Read directly the value of the signal without affecting any pushed batch signals.
Definition: MultiplicationSignal.cpp:42
MultiplicationSignal(const MultiplicationSignal &other)=delete
virtual ~MultiplicationSignal()=default
void setup_batch(void) override
Prepare the signal for being updated through side effects by the owner's read_batch step....
Definition: MultiplicationSignal.cpp:25
MultiplicationSignal(std::shared_ptr< Signal > multiplier, double multiplicand)
Definition: MultiplicationSignal.cpp:15
double sample(void) override
Apply any conversions necessary to interpret the latest stored value as a double.
Definition: MultiplicationSignal.cpp:33
MultiplicationSignal & operator=(const MultiplicationSignal &other)=delete
Definition: Signal.hpp:16
Definition: Agg.cpp:20