geopm 3.2.1.dev237+gbe30cff60
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
MSRFieldSignal.hpp
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015 - 2025 Intel Corporation
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef MSRFIELDSIGNAL_HPP_INCLUDE
7#define MSRFIELDSIGNAL_HPP_INCLUDE
8
9#include <cstdint>
10#include <cmath>
11
12#include <string>
13#include <memory>
14
15#include "Signal.hpp"
16
17namespace geopm
18{
19 class RolloverGenerator;
25 class MSRFieldSignal : public Signal
26 {
27 public:
28 MSRFieldSignal(std::shared_ptr<Signal> raw_msr,
29 int begin_bit,
30 int end_bit,
31 int function,
32 double scalar);
33 MSRFieldSignal(const MSRFieldSignal &other) = delete;
34 MSRFieldSignal &operator=(const MSRFieldSignal &other) = delete;
35 virtual ~MSRFieldSignal() = default;
36 void setup_batch(void) override;
37 double sample(void) override;
38 double read(void) const override;
39 private:
40 double convert_raw_value(double val) const;
49 std::shared_ptr<Signal> m_raw_msr;
50 const int m_shift;
51 const int m_num_bit;
52 const uint64_t m_mask;
53 const int m_function;
54 const double m_scalar;
55 bool m_is_batch_ready;
56 std::shared_ptr<RolloverGenerator> m_rollover_gen;
57 };
58}
59
60#endif
Definition MSRFieldSignal.hpp:26
double read(void) const override
Read directly the value of the signal without affecting any pushed batch signals.
Definition MSRFieldSignal.cpp:107
void setup_batch(void) override
Prepare the signal for being updated through side effects by the owner's read_batch step....
Definition MSRFieldSignal.cpp:54
MSRFieldSignal(const MSRFieldSignal &other)=delete
MSRFieldSignal & operator=(const MSRFieldSignal &other)=delete
virtual ~MSRFieldSignal()=default
double sample(void) override
Apply any conversions necessary to interpret the latest stored value as a double.
Definition MSRFieldSignal.cpp:98
Definition Signal.hpp:16
Definition Agg.cpp:20