geopm 3.1.1.dev456+g3ba31824
GEOPM - Global Extensible Open Power Manager
Loading...
Searching...
No Matches
RawMSRSignal.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 RAWMSRSIGNAL_HPP_INCLUDE
7#define RAWMSRSIGNAL_HPP_INCLUDE
8
9#include <cstdint>
10#include <cmath>
11
12#include <string>
13#include <memory>
14
15#include "Signal.hpp"
16
17
18namespace geopm
19{
20 class MSRIO;
21
22 class RawMSRSignal : public Signal
23 {
24 public:
25 RawMSRSignal(std::shared_ptr<MSRIO> msrio,
26 int cpu,
27 uint64_t offset);
28 RawMSRSignal(const RawMSRSignal &other) = delete;
29 RawMSRSignal &operator=(const RawMSRSignal &other) = delete;
30 virtual ~RawMSRSignal() = default;
31 void setup_batch(void) override;
32 double sample(void) override;
33 double read(void) const override;
34 private:
38 std::shared_ptr<MSRIO> m_msrio;
39 int m_cpu;
40 uint64_t m_offset;
43 int m_data_idx;
44 bool m_is_batch_ready;
45 };
46}
47
48#endif
Definition RawMSRSignal.hpp:23
void setup_batch(void) override
Prepare the signal for being updated through side effects by the owner's read_batch step....
Definition RawMSRSignal.cpp:29
double read(void) const override
Read directly the value of the signal without affecting any pushed batch signals.
Definition RawMSRSignal.cpp:53
RawMSRSignal(const RawMSRSignal &other)=delete
RawMSRSignal & operator=(const RawMSRSignal &other)=delete
double sample(void) override
Apply any conversions necessary to interpret the latest stored value as a double.
Definition RawMSRSignal.cpp:41
virtual ~RawMSRSignal()=default
Definition Signal.hpp:16
Definition Agg.cpp:20