gem5  v22.1.0.0
Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
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. More...
 
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. More...
 

Friends

constexpr friend Temperature operator* (const Temperature &lhs, const double &rhs)
 
constexpr friend Temperature operator* (const double &lhs, const Temperature &rhs)
 
constexpr friend 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()

constexpr 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!=()

constexpr 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+()

constexpr 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-()

constexpr 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<()

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

Definition at line 84 of file temperature.hh.

References value.

◆ operator<=()

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

Definition at line 90 of file temperature.hh.

References value.

◆ operator==()

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

Definition at line 97 of file temperature.hh.

References value.

◆ operator>()

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

Definition at line 73 of file temperature.hh.

References value.

◆ operator>=()

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

Definition at line 79 of file temperature.hh.

References value.

◆ toCelsius()

constexpr 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()

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

Friends And Related Function Documentation

◆ operator* [1/2]

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

Definition at line 167 of file temperature.hh.

◆ operator* [2/2]

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

Definition at line 161 of file temperature.hh.

◆ operator/

constexpr friend 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

double gem5::Temperature::value
private

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

Generated on Wed Dec 21 2022 10:23:12 for gem5 by doxygen 1.9.1