#include <SEScalar.h>

Inherits SEProperty.

Inherited by SEScalarEnum< eSwitch >, SEScalarEnum< eBreathState >, SEScalar0To1, SEScalarEnum< Enum >, SEScalarNegative1To1, SEScalarUnsigned, and SEUnitScalar.

Public Member Functions

 SEScalar ()
 
virtual ~SEScalar ()
 
void Invalidate () override
 
virtual void ForceInvalidate ()
 
bool Set (const SEScalar &s)
 
bool Force (const SEScalar &s)
 
void Copy (const SEScalar &s)
 
bool IsValid () const override
 
bool IsInfinity () const
 
bool IsPositive () const
 
bool IsNegative () const
 
bool IsZero (double limit=ZERO_APPROX) const
 
void SetReadOnly (bool b)
 
bool IsReadOnly () const
 
double GetValue () const
 
double GetValue (int precision) const
 
void SetValue (double d)
 
void ForceValue (double d)
 
double Increment (const SEScalar &s)
 
double Increment (double d)
 
double ForceIncrement (double d)
 
double Multiply (double d)
 
void Average (int cnt)
 
bool Equals (const SEScalar &to) const
 
virtual std::string ToString () const
 
virtual void ToString (std::ostream &str) const
 
- Public Member Functions inherited from SEProperty
 SEProperty ()
 
virtual ~SEProperty ()
 
virtual void Invalidate ()=0
 
virtual bool IsValid () const =0
 

Static Public Member Functions

static double dNaN ()
 
static bool IsNumber (double d)
 
static bool IsZero (double value, double limit)
 
static bool IsValue (double target, double value)
 
static double Truncate (double value, int decimal_places)
 

Protected Attributes

double m_value
 
bool m_isnan =true
 
bool m_isinf =false
 
bool m_readOnly =false
 

Friends

class PBProperty
 

Constructor & Destructor Documentation

◆ SEScalar()

SEScalar::SEScalar ( )

◆ ~SEScalar()

SEScalar::~SEScalar ( )
virtual

Member Function Documentation

◆ Average()

void SEScalar::Average ( int  cnt)

◆ Copy()

void SEScalar::Copy ( const SEScalar s)

Copies the entire contents of the provided scalar to this. Even if s is invalid.

◆ dNaN()

double SEScalar::dNaN ( )
static

◆ Equals()

bool SEScalar::Equals ( const SEScalar to) const

◆ Force()

bool SEScalar::Force ( const SEScalar s)

◆ ForceIncrement()

double SEScalar::ForceIncrement ( double  d)

◆ ForceInvalidate()

void SEScalar::ForceInvalidate ( )
virtual

Reimplemented in SEScalarEnum< Enum >, SEScalarEnum< eSwitch >, SEScalarEnum< eBreathState >, SEScalarQuantity< Unit >, SEScalarQuantity< AmountUnit >, SEScalarQuantity< AmountPerMassUnit >, SEScalarQuantity< AmountPerTimeUnit >, SEScalarQuantity< AmountPerVolumeUnit >, SEScalarQuantity< AreaUnit >, SEScalarQuantity< AreaPerTimePressureUnit >, SEScalarQuantity< ElectricCapacitanceUnit >, SEScalarQuantity< ElectricChargeUnit >, SEScalarQuantity< ElectricCurrentUnit >, SEScalarQuantity< ElectricInductanceUnit >, SEScalarQuantity< ElectricPotentialUnit >, SEScalarQuantity< ElectricResistanceUnit >, SEScalarQuantity< EnergyUnit >, SEScalarQuantity< EnergyPerAmountUnit >, SEScalarQuantity< EnergyPerMassUnit >, SEScalarQuantity< EquivalentWeightPerVolumeUnit >, SEScalarQuantity< ForceUnit >, SEScalarQuantity< FrequencyUnit >, SEScalarQuantity< HeatCapacitanceUnit >, SEScalarQuantity< HeatCapacitancePerAmountUnit >, SEScalarQuantity< HeatCapacitancePerMassUnit >, SEScalarQuantity< HeatConductanceUnit >, SEScalarQuantity< HeatConductancePerAreaUnit >, SEScalarQuantity< HeatInductanceUnit >, SEScalarQuantity< HeatResistanceUnit >, SEScalarQuantity< HeatResistanceAreaUnit >, SEScalarQuantity< InversePressureUnit >, SEScalarQuantity< InverseVolumeUnit >, SEScalarQuantity< LengthUnit >, SEScalarQuantity< LengthPerTimeUnit >, SEScalarQuantity< LengthPerTimePressureUnit >, SEScalarQuantity< MassUnit >, SEScalarQuantity< MassPerAmountUnit >, SEScalarQuantity< MassPerAreaTimeUnit >, SEScalarQuantity< MassPerMassUnit >, SEScalarQuantity< MassPerTimeUnit >, SEScalarQuantity< MassPerVolumeUnit >, SEScalarQuantity< OsmolalityUnit >, SEScalarQuantity< OsmolarityUnit >, SEScalarQuantity< PowerUnit >, SEScalarQuantity< PowerPerAreaTemperatureToTheFourthUnit >, SEScalarQuantity< PressureUnit >, SEScalarQuantity< PressurePerVolumeUnit >, SEScalarQuantity< PressureTimePerAreaUnit >, SEScalarQuantity< PressureTimePerVolumeUnit >, SEScalarQuantity< PressureTimePerVolumeAreaUnit >, SEScalarQuantity< PressureTimeSquaredPerVolumeUnit >, SEScalarQuantity< TemperatureUnit >, SEScalarQuantity< TimeUnit >, SEScalarQuantity< VolumeUnit >, SEScalarQuantity< VolumePerPressureUnit >, SEScalarQuantity< VolumePerTimeUnit >, SEScalarQuantity< VolumePerTimeAreaUnit >, SEScalarQuantity< VolumePerTimeMassUnit >, SEScalarQuantity< VolumePerTimePressureUnit >, SEScalarQuantity< VolumePerTimePressureAreaUnit >, and SEUnitScalar.

◆ ForceValue()

void SEScalar::ForceValue ( double  d)

◆ GetValue() [1/2]

double SEScalar::GetValue ( ) const

◆ GetValue() [2/2]

double SEScalar::GetValue ( int  precision) const

◆ Increment() [1/2]

double SEScalar::Increment ( const SEScalar s)

◆ Increment() [2/2]

double SEScalar::Increment ( double  d)

◆ Invalidate()

void SEScalar::Invalidate ( )
overridevirtual

Sets the value to NaN and removes the unit Note that this does not affect bounds

Implements SEProperty.

Reimplemented in SEScalarEnum< Enum >, SEScalarEnum< eSwitch >, SEScalarEnum< eBreathState >, SEScalarQuantity< Unit >, SEScalarQuantity< AmountUnit >, SEScalarQuantity< AmountPerMassUnit >, SEScalarQuantity< AmountPerTimeUnit >, SEScalarQuantity< AmountPerVolumeUnit >, SEScalarQuantity< AreaUnit >, SEScalarQuantity< AreaPerTimePressureUnit >, SEScalarQuantity< ElectricCapacitanceUnit >, SEScalarQuantity< ElectricChargeUnit >, SEScalarQuantity< ElectricCurrentUnit >, SEScalarQuantity< ElectricInductanceUnit >, SEScalarQuantity< ElectricPotentialUnit >, SEScalarQuantity< ElectricResistanceUnit >, SEScalarQuantity< EnergyUnit >, SEScalarQuantity< EnergyPerAmountUnit >, SEScalarQuantity< EnergyPerMassUnit >, SEScalarQuantity< EquivalentWeightPerVolumeUnit >, SEScalarQuantity< ForceUnit >, SEScalarQuantity< FrequencyUnit >, SEScalarQuantity< HeatCapacitanceUnit >, SEScalarQuantity< HeatCapacitancePerAmountUnit >, SEScalarQuantity< HeatCapacitancePerMassUnit >, SEScalarQuantity< HeatConductanceUnit >, SEScalarQuantity< HeatConductancePerAreaUnit >, SEScalarQuantity< HeatInductanceUnit >, SEScalarQuantity< HeatResistanceUnit >, SEScalarQuantity< HeatResistanceAreaUnit >, SEScalarQuantity< InversePressureUnit >, SEScalarQuantity< InverseVolumeUnit >, SEScalarQuantity< LengthUnit >, SEScalarQuantity< LengthPerTimeUnit >, SEScalarQuantity< LengthPerTimePressureUnit >, SEScalarQuantity< MassUnit >, SEScalarQuantity< MassPerAmountUnit >, SEScalarQuantity< MassPerAreaTimeUnit >, SEScalarQuantity< MassPerMassUnit >, SEScalarQuantity< MassPerTimeUnit >, SEScalarQuantity< MassPerVolumeUnit >, SEScalarQuantity< OsmolalityUnit >, SEScalarQuantity< OsmolarityUnit >, SEScalarQuantity< PowerUnit >, SEScalarQuantity< PowerPerAreaTemperatureToTheFourthUnit >, SEScalarQuantity< PressureUnit >, SEScalarQuantity< PressurePerVolumeUnit >, SEScalarQuantity< PressureTimePerAreaUnit >, SEScalarQuantity< PressureTimePerVolumeUnit >, SEScalarQuantity< PressureTimePerVolumeAreaUnit >, SEScalarQuantity< PressureTimeSquaredPerVolumeUnit >, SEScalarQuantity< TemperatureUnit >, SEScalarQuantity< TimeUnit >, SEScalarQuantity< VolumeUnit >, SEScalarQuantity< VolumePerPressureUnit >, SEScalarQuantity< VolumePerTimeUnit >, SEScalarQuantity< VolumePerTimeAreaUnit >, SEScalarQuantity< VolumePerTimeMassUnit >, SEScalarQuantity< VolumePerTimePressureUnit >, SEScalarQuantity< VolumePerTimePressureAreaUnit >, and SEUnitScalar.

◆ IsInfinity()

bool SEScalar::IsInfinity ( ) const
inline

◆ IsNegative()

bool SEScalar::IsNegative ( ) const

◆ IsNumber()

bool SEScalar::IsNumber ( double  d)
static

◆ IsPositive()

bool SEScalar::IsPositive ( ) const

◆ IsReadOnly()

bool SEScalar::IsReadOnly ( ) const

◆ IsValid()

bool SEScalar::IsValid ( ) const
overridevirtual

Implements SEProperty.

Reimplemented in SEScalarQuantity< Unit >, SEScalarQuantity< AmountUnit >, SEScalarQuantity< AmountPerMassUnit >, SEScalarQuantity< AmountPerTimeUnit >, SEScalarQuantity< AmountPerVolumeUnit >, SEScalarQuantity< AreaUnit >, SEScalarQuantity< AreaPerTimePressureUnit >, SEScalarQuantity< ElectricCapacitanceUnit >, SEScalarQuantity< ElectricChargeUnit >, SEScalarQuantity< ElectricCurrentUnit >, SEScalarQuantity< ElectricInductanceUnit >, SEScalarQuantity< ElectricPotentialUnit >, SEScalarQuantity< ElectricResistanceUnit >, SEScalarQuantity< EnergyUnit >, SEScalarQuantity< EnergyPerAmountUnit >, SEScalarQuantity< EnergyPerMassUnit >, SEScalarQuantity< EquivalentWeightPerVolumeUnit >, SEScalarQuantity< ForceUnit >, SEScalarQuantity< FrequencyUnit >, SEScalarQuantity< HeatCapacitanceUnit >, SEScalarQuantity< HeatCapacitancePerAmountUnit >, SEScalarQuantity< HeatCapacitancePerMassUnit >, SEScalarQuantity< HeatConductanceUnit >, SEScalarQuantity< HeatConductancePerAreaUnit >, SEScalarQuantity< HeatInductanceUnit >, SEScalarQuantity< HeatResistanceUnit >, SEScalarQuantity< HeatResistanceAreaUnit >, SEScalarQuantity< InversePressureUnit >, SEScalarQuantity< InverseVolumeUnit >, SEScalarQuantity< LengthUnit >, SEScalarQuantity< LengthPerTimeUnit >, SEScalarQuantity< LengthPerTimePressureUnit >, SEScalarQuantity< MassUnit >, SEScalarQuantity< MassPerAmountUnit >, SEScalarQuantity< MassPerAreaTimeUnit >, SEScalarQuantity< MassPerMassUnit >, SEScalarQuantity< MassPerTimeUnit >, SEScalarQuantity< MassPerVolumeUnit >, SEScalarQuantity< OsmolalityUnit >, SEScalarQuantity< OsmolarityUnit >, SEScalarQuantity< PowerUnit >, SEScalarQuantity< PowerPerAreaTemperatureToTheFourthUnit >, SEScalarQuantity< PressureUnit >, SEScalarQuantity< PressurePerVolumeUnit >, SEScalarQuantity< PressureTimePerAreaUnit >, SEScalarQuantity< PressureTimePerVolumeUnit >, SEScalarQuantity< PressureTimePerVolumeAreaUnit >, SEScalarQuantity< PressureTimeSquaredPerVolumeUnit >, SEScalarQuantity< TemperatureUnit >, SEScalarQuantity< TimeUnit >, SEScalarQuantity< VolumeUnit >, SEScalarQuantity< VolumePerPressureUnit >, SEScalarQuantity< VolumePerTimeUnit >, SEScalarQuantity< VolumePerTimeAreaUnit >, SEScalarQuantity< VolumePerTimeMassUnit >, SEScalarQuantity< VolumePerTimePressureUnit >, SEScalarQuantity< VolumePerTimePressureAreaUnit >, and SEUnitScalar.

◆ IsValue()

bool SEScalar::IsValue ( double  target,
double  value 
)
static

◆ IsZero() [1/2]

bool SEScalar::IsZero ( double  limit = ZERO_APPROX) const

◆ IsZero() [2/2]

bool SEScalar::IsZero ( double  value,
double  limit 
)
static

◆ Multiply()

double SEScalar::Multiply ( double  d)

◆ Set()

bool SEScalar::Set ( const SEScalar s)

Copies ONLY the value and unit ONLY if the provided scalar is valid.

◆ SetReadOnly()

void SEScalar::SetReadOnly ( bool  b)

◆ SetValue()

void SEScalar::SetValue ( double  d)

◆ ToString() [1/2]

std::string SEScalar::ToString ( ) const
virtual

Reimplemented in SEScalarQuantity< Unit >, SEScalarQuantity< AmountUnit >, SEScalarQuantity< AmountPerMassUnit >, SEScalarQuantity< AmountPerTimeUnit >, SEScalarQuantity< AmountPerVolumeUnit >, SEScalarQuantity< AreaUnit >, SEScalarQuantity< AreaPerTimePressureUnit >, SEScalarQuantity< ElectricCapacitanceUnit >, SEScalarQuantity< ElectricChargeUnit >, SEScalarQuantity< ElectricCurrentUnit >, SEScalarQuantity< ElectricInductanceUnit >, SEScalarQuantity< ElectricPotentialUnit >, SEScalarQuantity< ElectricResistanceUnit >, SEScalarQuantity< EnergyUnit >, SEScalarQuantity< EnergyPerAmountUnit >, SEScalarQuantity< EnergyPerMassUnit >, SEScalarQuantity< EquivalentWeightPerVolumeUnit >, SEScalarQuantity< ForceUnit >, SEScalarQuantity< FrequencyUnit >, SEScalarQuantity< HeatCapacitanceUnit >, SEScalarQuantity< HeatCapacitancePerAmountUnit >, SEScalarQuantity< HeatCapacitancePerMassUnit >, SEScalarQuantity< HeatConductanceUnit >, SEScalarQuantity< HeatConductancePerAreaUnit >, SEScalarQuantity< HeatInductanceUnit >, SEScalarQuantity< HeatResistanceUnit >, SEScalarQuantity< HeatResistanceAreaUnit >, SEScalarQuantity< InversePressureUnit >, SEScalarQuantity< InverseVolumeUnit >, SEScalarQuantity< LengthUnit >, SEScalarQuantity< LengthPerTimeUnit >, SEScalarQuantity< LengthPerTimePressureUnit >, SEScalarQuantity< MassUnit >, SEScalarQuantity< MassPerAmountUnit >, SEScalarQuantity< MassPerAreaTimeUnit >, SEScalarQuantity< MassPerMassUnit >, SEScalarQuantity< MassPerTimeUnit >, SEScalarQuantity< MassPerVolumeUnit >, SEScalarQuantity< OsmolalityUnit >, SEScalarQuantity< OsmolarityUnit >, SEScalarQuantity< PowerUnit >, SEScalarQuantity< PowerPerAreaTemperatureToTheFourthUnit >, SEScalarQuantity< PressureUnit >, SEScalarQuantity< PressurePerVolumeUnit >, SEScalarQuantity< PressureTimePerAreaUnit >, SEScalarQuantity< PressureTimePerVolumeUnit >, SEScalarQuantity< PressureTimePerVolumeAreaUnit >, SEScalarQuantity< PressureTimeSquaredPerVolumeUnit >, SEScalarQuantity< TemperatureUnit >, SEScalarQuantity< TimeUnit >, SEScalarQuantity< VolumeUnit >, SEScalarQuantity< VolumePerPressureUnit >, SEScalarQuantity< VolumePerTimeUnit >, SEScalarQuantity< VolumePerTimeAreaUnit >, SEScalarQuantity< VolumePerTimeMassUnit >, SEScalarQuantity< VolumePerTimePressureUnit >, and SEScalarQuantity< VolumePerTimePressureAreaUnit >.

◆ ToString() [2/2]

void SEScalar::ToString ( std::ostream &  str) const
virtual

Reimplemented in SEScalarQuantity< Unit >, SEScalarQuantity< AmountUnit >, SEScalarQuantity< AmountPerMassUnit >, SEScalarQuantity< AmountPerTimeUnit >, SEScalarQuantity< AmountPerVolumeUnit >, SEScalarQuantity< AreaUnit >, SEScalarQuantity< AreaPerTimePressureUnit >, SEScalarQuantity< ElectricCapacitanceUnit >, SEScalarQuantity< ElectricChargeUnit >, SEScalarQuantity< ElectricCurrentUnit >, SEScalarQuantity< ElectricInductanceUnit >, SEScalarQuantity< ElectricPotentialUnit >, SEScalarQuantity< ElectricResistanceUnit >, SEScalarQuantity< EnergyUnit >, SEScalarQuantity< EnergyPerAmountUnit >, SEScalarQuantity< EnergyPerMassUnit >, SEScalarQuantity< EquivalentWeightPerVolumeUnit >, SEScalarQuantity< ForceUnit >, SEScalarQuantity< FrequencyUnit >, SEScalarQuantity< HeatCapacitanceUnit >, SEScalarQuantity< HeatCapacitancePerAmountUnit >, SEScalarQuantity< HeatCapacitancePerMassUnit >, SEScalarQuantity< HeatConductanceUnit >, SEScalarQuantity< HeatConductancePerAreaUnit >, SEScalarQuantity< HeatInductanceUnit >, SEScalarQuantity< HeatResistanceUnit >, SEScalarQuantity< HeatResistanceAreaUnit >, SEScalarQuantity< InversePressureUnit >, SEScalarQuantity< InverseVolumeUnit >, SEScalarQuantity< LengthUnit >, SEScalarQuantity< LengthPerTimeUnit >, SEScalarQuantity< LengthPerTimePressureUnit >, SEScalarQuantity< MassUnit >, SEScalarQuantity< MassPerAmountUnit >, SEScalarQuantity< MassPerAreaTimeUnit >, SEScalarQuantity< MassPerMassUnit >, SEScalarQuantity< MassPerTimeUnit >, SEScalarQuantity< MassPerVolumeUnit >, SEScalarQuantity< OsmolalityUnit >, SEScalarQuantity< OsmolarityUnit >, SEScalarQuantity< PowerUnit >, SEScalarQuantity< PowerPerAreaTemperatureToTheFourthUnit >, SEScalarQuantity< PressureUnit >, SEScalarQuantity< PressurePerVolumeUnit >, SEScalarQuantity< PressureTimePerAreaUnit >, SEScalarQuantity< PressureTimePerVolumeUnit >, SEScalarQuantity< PressureTimePerVolumeAreaUnit >, SEScalarQuantity< PressureTimeSquaredPerVolumeUnit >, SEScalarQuantity< TemperatureUnit >, SEScalarQuantity< TimeUnit >, SEScalarQuantity< VolumeUnit >, SEScalarQuantity< VolumePerPressureUnit >, SEScalarQuantity< VolumePerTimeUnit >, SEScalarQuantity< VolumePerTimeAreaUnit >, SEScalarQuantity< VolumePerTimeMassUnit >, SEScalarQuantity< VolumePerTimePressureUnit >, and SEScalarQuantity< VolumePerTimePressureAreaUnit >.

◆ Truncate()

double SEScalar::Truncate ( double  value,
int  decimal_places 
)
static

Friends And Related Function Documentation

◆ PBProperty

friend class PBProperty
friend

Member Data Documentation

◆ m_isinf

bool SEScalar::m_isinf =false
protected

◆ m_isnan

bool SEScalar::m_isnan =true
protected

◆ m_readOnly

bool SEScalar::m_readOnly =false
protected

◆ m_value

double SEScalar::m_value
protected

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.