SyDEVS  v0.6.7
Multiscale Simulation and Systems Modeling Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
sydevs::quantity_base Class Reference

A base class for quantities, defining operations that do not depend on the dimension. More...

#include <quantity.h>

Inherited by sydevs::quantity< seconds >, sydevs::quantity< U >, and sydevs::quantity< no_units >.

Public Member Functions

constexpr bool valid () const
 Returns true if the quantity value is valid. More...
 
constexpr bool finite () const
 Returns true if the quantity value is finite. More...
 
constexpr int64 multiplier () const
 Returns the number that multiples the length precision. More...
 
constexpr scale precision () const
 Returns the length precision. More...
 
constexpr bool fixed () const
 Returns true if the quantity value has a fixed length precision. More...
 

Protected Member Functions

constexpr quantity_base ()
 
constexpr quantity_base (int64 multiplier)
 
constexpr quantity_base (int64 multiplier, scale precision)
 
constexpr quantity_base (int64 multiplier, scale precision, bool fixed)
 
constexpr quantity_base (scale precision, float64 multiplier, int8 fixed)
 
constexpr quantity_base (const quantity_base &)=default
 Copy constructor. More...
 
quantity_baseoperator= (const quantity_base &)=default
 Copy assignment. More...
 
 quantity_base (quantity_base &&)=default
 Move constructor. More...
 
quantity_baseoperator= (quantity_base &&)=default
 Move assignment. More...
 
 ~quantity_base ()=default
 Destructor. More...
 

Static Protected Member Functions

static constexpr int64 constexpr_abs (int64 n)
 
static constexpr float64 constexpr_abs (float64 x)
 
static constexpr float64 convert_multiplier (int64 multiplier)
 
static constexpr int64 convert_level (int64 multiplier, int64 level)
 
static constexpr float64 offset_multiplier (float64 multiplier)
 
static constexpr int64 truncate_multiplier (float64 multiplier)
 
static constexpr int64 round_multiplier (float64 multiplier)
 
static constexpr int64 scale_multiplier (float64 multiplier, float64 factor)
 

Protected Attributes

float64 multiplier_
 
scale precision_
 
int8 fixed_
 

Static Protected Attributes

static constexpr float64 inf_float64 = std::numeric_limits<float64>::infinity()
 
static constexpr float64 nan_float64 = std::numeric_limits<float64>::quiet_NaN()
 
static constexpr int64 inf_int64 = std::numeric_limits<int64>::max()
 
static constexpr int64 nan_int64 = std::numeric_limits<int64>::min()
 

Detailed Description

A base class for quantities, defining operations that do not depend on the dimension.

Constructor & Destructor Documentation

constexpr sydevs::quantity_base::quantity_base ( )
protected
constexpr sydevs::quantity_base::quantity_base ( int64  multiplier)
explicitprotected
constexpr sydevs::quantity_base::quantity_base ( int64  multiplier,
scale  precision 
)
protected
constexpr sydevs::quantity_base::quantity_base ( int64  multiplier,
scale  precision,
bool  fixed 
)
protected
constexpr sydevs::quantity_base::quantity_base ( scale  precision,
float64  multiplier,
int8  fixed 
)
protected
constexpr sydevs::quantity_base::quantity_base ( const quantity_base )
protecteddefault

Copy constructor.

sydevs::quantity_base::quantity_base ( quantity_base &&  )
protecteddefault

Move constructor.

sydevs::quantity_base::~quantity_base ( )
protecteddefault

Destructor.

Member Function Documentation

constexpr int64 sydevs::quantity_base::constexpr_abs ( int64  n)
staticprotected
constexpr float64 sydevs::quantity_base::constexpr_abs ( float64  x)
staticprotected
constexpr int64 sydevs::quantity_base::convert_level ( int64  multiplier,
int64  level 
)
staticprotected
constexpr float64 sydevs::quantity_base::convert_multiplier ( int64  multiplier)
staticprotected
constexpr bool sydevs::quantity_base::finite ( ) const

Returns true if the quantity value is finite.

constexpr bool sydevs::quantity_base::fixed ( ) const

Returns true if the quantity value has a fixed length precision.

constexpr int64 sydevs::quantity_base::multiplier ( ) const

Returns the number that multiples the length precision.

constexpr float64 sydevs::quantity_base::offset_multiplier ( float64  multiplier)
staticprotected
quantity_base& sydevs::quantity_base::operator= ( const quantity_base )
protecteddefault

Copy assignment.

quantity_base& sydevs::quantity_base::operator= ( quantity_base &&  )
protecteddefault

Move assignment.

constexpr scale sydevs::quantity_base::precision ( ) const

Returns the length precision.

constexpr int64 sydevs::quantity_base::round_multiplier ( float64  multiplier)
staticprotected
constexpr int64 sydevs::quantity_base::scale_multiplier ( float64  multiplier,
float64  factor 
)
staticprotected
constexpr int64 sydevs::quantity_base::truncate_multiplier ( float64  multiplier)
staticprotected
constexpr bool sydevs::quantity_base::valid ( ) const

Returns true if the quantity value is valid.

Member Data Documentation

int8 sydevs::quantity_base::fixed_
protected
constexpr float64 sydevs::quantity_base::inf_float64 = std::numeric_limits<float64>::infinity()
staticprotected
constexpr int64 sydevs::quantity_base::inf_int64 = std::numeric_limits<int64>::max()
staticprotected
float64 sydevs::quantity_base::multiplier_
protected
constexpr float64 sydevs::quantity_base::nan_float64 = std::numeric_limits<float64>::quiet_NaN()
staticprotected
constexpr int64 sydevs::quantity_base::nan_int64 = std::numeric_limits<int64>::min()
staticprotected
scale sydevs::quantity_base::precision_
protected

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