SuperNOVAS C++ API v1.6
High-precision C/C++ astrometry library
Loading...
Searching...
No Matches
supernovas::Temperature Class Reference

A physical temperature value, which can be instantiated, and then expressed, in different commonly used temperature units (C, K, or F). More...

#include <supernovas.h>

Inheritance diagram for supernovas::Temperature:

Public Member Functions

double celsius () const
 Returns the temperature value in degrees Celsius.
double farenheit () const
 Returns the temperature value in degrees Farenheit.
double kelvin () const
 Returns the temperature value in degrees Kelvin.
std::string to_string () const
 Returns a human-readable string representation of this temperature value.
Public Member Functions inherited from supernovas::Validating
bool is_valid () const
 Returns the previously set 'valid' stae of the implementing instance.
 operator bool () const
 Objects that implement Validating can be used in conditionals directly, without explicitly calling is_valid().

Static Public Member Functions

static Temperature celsius (double value)
 Returns a new temperature object, with the specified temperature value defined in degrees Celsius.
static Temperature farenheit (double value)
 Returns a new temperature object, with the specified temperature value defined in degrees Farenheit.
static Temperature kelvin (double value)
 Returns a new temperature object, with the specified temperature value defined in degrees Kelvin.

Additional Inherited Members

Protected Member Functions inherited from supernovas::Validating
 Validating ()
 dummy constructor;
Protected Attributes inherited from supernovas::Validating
bool _valid = false
 the state variable.

Detailed Description

A physical temperature value, which can be instantiated, and then expressed, in different commonly used temperature units (C, K, or F).

Within SuperNOVAS it is normally used to express ambient temperatures at an observing location, but users may utilize it in any other context also.

See also
Weather

Member Function Documentation

◆ celsius() [1/2]

double supernovas::Temperature::celsius ( ) const

Returns the temperature value in degrees Celsius.

Returns
[C] The temperature value
See also
kelvin(), farenheit()

References celsius().

Referenced by celsius(), celsius(), and supernovas::Source::horizontal_track().

◆ celsius() [2/2]

Temperature supernovas::Temperature::celsius ( double value)
static

Returns a new temperature object, with the specified temperature value defined in degrees Celsius.

Parameters
value[C] temperature value
Returns
A new temperature object with the specified value.
See also
kelvin(), farenheit()

References celsius(), and supernovas::Validating::is_valid().

◆ farenheit() [1/2]

double supernovas::Temperature::farenheit ( ) const

Returns the temperature value in degrees Farenheit.

Returns
[F] The temperature value
See also
celsius(), kelvin()

References farenheit().

Referenced by farenheit(), and farenheit().

◆ farenheit() [2/2]

Temperature supernovas::Temperature::farenheit ( double value)
static

Returns a new temperature object, with the specified temperature value defined in degrees Farenheit.

Parameters
value[F] temperature value
Returns
A new temperature object with the specified value.
See also
celisus(), kelvin()

References farenheit(), and supernovas::Validating::is_valid().

◆ kelvin() [1/2]

double supernovas::Temperature::kelvin ( ) const

Returns the temperature value in degrees Kelvin.

Returns
[K] The temperature value
See also
celsius(), farenheit()

References kelvin().

Referenced by kelvin(), and kelvin().

◆ kelvin() [2/2]

Temperature supernovas::Temperature::kelvin ( double value)
static

Returns a new temperature object, with the specified temperature value defined in degrees Kelvin.

Parameters
value[K] temperature value
Returns
A new temperature object with the specified value.
See also
celsius(), farenheit()

References supernovas::Validating::is_valid(), and kelvin().

◆ to_string()

std::string supernovas::Temperature::to_string ( ) const

Returns a human-readable string representation of this temperature value.

Returns
a string with the human readable representation of this temperature.

References to_string().

Referenced by to_string().