geopm  3.1.1.dev214+gba4f9f6d
GEOPM - Global Extensible Open Power Manager
Public Member Functions | List of all members
geopm::MSRFieldSignal Class Reference

#include <MSRFieldSignal.hpp>

Inheritance diagram for geopm::MSRFieldSignal:
Inheritance graph
[legend]
Collaboration diagram for geopm::MSRFieldSignal:
Collaboration graph
[legend]

Public Member Functions

 MSRFieldSignal (std::shared_ptr< Signal > raw_msr, int begin_bit, int end_bit, int function, double scalar)
 
 MSRFieldSignal (const MSRFieldSignal &other)=delete
 
MSRFieldSignaloperator= (const MSRFieldSignal &other)=delete
 
virtual ~MSRFieldSignal ()=default
 
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. More...
 
double sample (void) override
 Apply any conversions necessary to interpret the latest stored value as a double. More...
 
double read (void) const override
 Read directly the value of the signal without affecting any pushed batch signals. More...
 
- Public Member Functions inherited from geopm::Signal
virtual ~Signal ()=default
 
virtual void set_sample (double)
 Set the value to be returned by sample() More...
 
virtual bool is_sampled (void) const
 True if the signal has been sampled during this batch. More...
 

Detailed Description

Encapsulates conversion of MSR bitfields to double signal values in SI units.

Todo:
: most implementation is the same as MSREncode class. The hope is that this class can eventually replace the use of MSREncode. The enum for the function comes from the MSR class.

Constructor & Destructor Documentation

◆ MSRFieldSignal() [1/2]

geopm::MSRFieldSignal::MSRFieldSignal ( std::shared_ptr< Signal raw_msr,
int  begin_bit,
int  end_bit,
int  function,
double  scalar 
)
Todo:
: some of these are not logic errors if MSR data comes from user input files or if this interface is public. Alternatively, checks for these at the json parsing step would make these correctly logic errors.

◆ MSRFieldSignal() [2/2]

geopm::MSRFieldSignal::MSRFieldSignal ( const MSRFieldSignal other)
delete

◆ ~MSRFieldSignal()

virtual geopm::MSRFieldSignal::~MSRFieldSignal ( )
virtualdefault

Member Function Documentation

◆ operator=()

MSRFieldSignal& geopm::MSRFieldSignal::operator= ( const MSRFieldSignal other)
delete

◆ read()

double geopm::MSRFieldSignal::read ( void  ) const
overridevirtual

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

Implements geopm::Signal.

◆ sample()

double geopm::MSRFieldSignal::sample ( void  )
overridevirtual

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

Implements geopm::Signal.

◆ setup_batch()

void geopm::MSRFieldSignal::setup_batch ( void  )
overridevirtual

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 files: