gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::Temperature Class Reference

The class stores temperatures in Kelvin and provides helper methods to convert to/from Celsius. More...

#include <temperature.hh>

Public Member Functions

constexpr Temperature (double _value=0.0)
 Explicit constructor assigning a value.
 
constexpr double toKelvin () const
 
constexpr double toCelsius () const
 
double toFahrenheit () const
 
constexpr bool operator> (const Temperature &rhs) const
 
constexpr bool operator>= (const Temperature &rhs) const
 
constexpr bool operator< (const Temperature &rhs) const
 
constexpr bool operator<= (const Temperature &rhs) const
 
constexpr bool operator== (const Temperature &rhs) const
 
constexpr bool operator!= (const Temperature &rhs) const
 
constexpr Temperature operator+ (const Temperature &rhs) const
 
constexpr Temperature operator- (const Temperature &rhs) const
 
Temperatureoperator+= (const Temperature &rhs)
 
Temperatureoperator-= (const Temperature &rhs)
 
Temperatureoperator*= (const double &rhs)
 
Temperatureoperator/= (const double &rhs)
 

Static Public Member Functions

static Temperature fromKelvin (double _value)
 
static Temperature fromCelsius (double _value)
 
static Temperature fromFahrenheit (double _value)
 

Private Attributes

double value
 Temperature in Kelvin.
 

Friends

constexpr Temperature operator* (const Temperature &lhs, const double &rhs)
 
constexpr Temperature operator* (const double &lhs, const Temperature &rhs)
 
constexpr Temperature operator/ (const Temperature &lhs, const double &rhs)
 
std::ostream & operator<< (std::ostream &out, const Temperature &t)
 

Detailed Description

The class stores temperatures in Kelvin and provides helper methods to convert to/from Celsius.

Definition at line 50 of file temperature.hh.

Constructor & Destructor Documentation

◆ Temperature()

gem5::Temperature::Temperature ( double _value = 0.0)
inlineexplicitconstexpr

Explicit constructor assigning a value.

Definition at line 59 of file temperature.hh.

Referenced by fromCelsius(), fromFahrenheit(), fromKelvin(), operator+(), and operator-().

Member Function Documentation

◆ fromCelsius()

Temperature gem5::Temperature::fromCelsius ( double _value)
static

Definition at line 50 of file temperature.cc.

References Temperature().

Referenced by gem5::pybind_init_core(), and TEST().

◆ fromFahrenheit()

Temperature gem5::Temperature::fromFahrenheit ( double _value)
static

Definition at line 56 of file temperature.cc.

References Temperature().

Referenced by gem5::pybind_init_core(), and TEST().

◆ fromKelvin()

Temperature gem5::Temperature::fromKelvin ( double _value)
static

◆ operator!=()

bool gem5::Temperature::operator!= ( const Temperature & rhs) const
inlineconstexpr

Definition at line 103 of file temperature.hh.

References value.

◆ operator*=()

Temperature & gem5::Temperature::operator*= ( const double & rhs)
inline

Definition at line 144 of file temperature.hh.

References value.

◆ operator+()

Temperature gem5::Temperature::operator+ ( const Temperature & rhs) const
inlineconstexpr

Definition at line 109 of file temperature.hh.

References Temperature(), and value.

◆ operator+=()

Temperature & gem5::Temperature::operator+= ( const Temperature & rhs)
inline

Definition at line 130 of file temperature.hh.

References value.

◆ operator-()

Temperature gem5::Temperature::operator- ( const Temperature & rhs) const
inlineconstexpr

Definition at line 115 of file temperature.hh.

References Temperature(), and value.

◆ operator-=()

Temperature & gem5::Temperature::operator-= ( const Temperature & rhs)
inline

Definition at line 137 of file temperature.hh.

References value.

◆ operator/=()

Temperature & gem5::Temperature::operator/= ( const double & rhs)
inline

Definition at line 151 of file temperature.hh.

References value.

◆ operator<()

bool gem5::Temperature::operator< ( const Temperature & rhs) const
inlineconstexpr

Definition at line 84 of file temperature.hh.

References value.

◆ operator<=()

bool gem5::Temperature::operator<= ( const Temperature & rhs) const
inlineconstexpr

Definition at line 90 of file temperature.hh.

References value.

◆ operator==()

bool gem5::Temperature::operator== ( const Temperature & rhs) const
inlineconstexpr

Definition at line 97 of file temperature.hh.

References value.

◆ operator>()

bool gem5::Temperature::operator> ( const Temperature & rhs) const
inlineconstexpr

Definition at line 73 of file temperature.hh.

References value.

◆ operator>=()

bool gem5::Temperature::operator>= ( const Temperature & rhs) const
inlineconstexpr

Definition at line 79 of file temperature.hh.

References value.

◆ toCelsius()

double gem5::Temperature::toCelsius ( ) const
inlineconstexpr

◆ toFahrenheit()

double gem5::Temperature::toFahrenheit ( ) const

Definition at line 62 of file temperature.cc.

References value.

Referenced by gem5::pybind_init_core().

◆ toKelvin()

double gem5::Temperature::toKelvin ( ) const
inlineconstexpr

Friends And Related Symbol Documentation

◆ operator* [1/2]

Temperature operator* ( const double & lhs,
const Temperature & rhs )
friend

Definition at line 167 of file temperature.hh.

◆ operator* [2/2]

Temperature operator* ( const Temperature & lhs,
const double & rhs )
friend

Definition at line 161 of file temperature.hh.

◆ operator/

Temperature operator/ ( const Temperature & lhs,
const double & rhs )
friend

Definition at line 173 of file temperature.hh.

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const Temperature & t )
friend

Definition at line 67 of file temperature.cc.

Member Data Documentation

◆ value


The documentation for this class was generated from the following files:

Generated on Tue Jun 18 2024 16:24:15 for gem5 by doxygen 1.11.0