AMCAX Kernel 1.0.0.0
AMCAX::LengthUnit Class Reference

Class for SI Base Units. More...

#include <misc/LengthUnit.hpp>

Inheritance diagram for AMCAX::LengthUnit:
Collaboration diagram for AMCAX::LengthUnit:

Public Member Functions

AMCAX_API LengthUnit ()
 Default constructor.
 
AMCAX_API LengthUnit (const LengthUnitType type)
 Construct a new LengthUnit object with a pre-defined non-SI unit. More...
 
AMCAX_API LengthUnit (const double multiplication)
 Construct a new LengthUnit object with a multiplication. More...
 
AMCAX_API LengthUnit (const UnitPrefix &prefix)
 Construct a new LengthUnit object with a prefix. More...
 
AMCAX_API LengthUnit (const LengthUnit &unit)
 Copy constructor. More...
 
AMCAX_API LengthUnit (const LengthUnit &&unit) noexcept
 Move constructor. More...
 
AMCAX_API LengthUnitoperator= (const LengthUnit &unit)
 Copy assignment operator. More...
 
AMCAX_API LengthUnitoperator= (const LengthUnit &&unit) noexcept
 Move assignment operator. More...
 
AMCAX_API ~LengthUnit () override
 Destructor.
 
AMCAX_API LengthUnitSetPrefix (const UnitPrefix prefix)
 Set the prefix of the unit. More...
 
AMCAX_API LengthUnitSetMultiplication (const double multiplication)
 Set the multiplication of the unit. More...
 
AMCAX_API bool operator== (const LengthUnit &other) const
 If the LengthUnit same as the other LengthUnit. More...
 
AMCAX_API bool operator!= (const LengthUnit &other) const
 If the LengthUnit different from the other LengthUnit. More...
 
AMCAX_API bool operator< (const LengthUnit &other) const
 If the LengthUnit less than the other LengthUnit. More...
 
AMCAX_API bool operator> (const LengthUnit &other) const
 If the LengthUnit greater than the other LengthUnit. More...
 
AMCAX_API bool operator<= (const LengthUnit &other) const
 If the LengthUnit less than or equal to the other LengthUnit. More...
 
AMCAX_API bool operator>= (const LengthUnit &other) const
 If the LengthUnit greater than or equal to the other LengthUnit. More...
 
AMCAX_API LengthUnitUseMicroMeter ()
 Set the unit to be a metric micro meter.
 
AMCAX_API LengthUnitUseMilliMeter ()
 Set the unit to be a metric milli meter.
 
AMCAX_API LengthUnitUseCentiMeter ()
 Set the unit to be a metric centi meter.
 
AMCAX_API LengthUnitUseDeciMeter ()
 Set the unit to be a metric deci meter.
 
AMCAX_API LengthUnitUseMeter ()
 Set the unit to be a metric meter.
 
AMCAX_API LengthUnitUseDecaMeter ()
 Set the unit to be a metric deca meter.
 
AMCAX_API LengthUnitUseHectoMeter ()
 Set the unit to be a metric hecto meter.
 
AMCAX_API LengthUnitUseKiloMeter ()
 Set the unit to be a metric kilo meter.
 
AMCAX_API LengthUnitUseFoot ()
 Set the unit to be a foot.
 
AMCAX_API LengthUnitUseInch ()
 Set the unit to be an inch.
 
AMCAX_API LengthUnitUseYard ()
 Set the unit to be a yard.
 
AMCAX_API LengthUnitUseMile ()
 Set the unit to be a mile.
 
- Public Member Functions inherited from AMCAX::AbstructUnit
AMCAX_API const UnitPrefixGetPrefix () const
 Get an immutable reference to the prefix of the unit. More...
 
AMCAX_API const double & GetMultiplication () const
 Get the derived prefix of the unit. More...
 
virtual AMCAX_API double ToBase (const double value=1.0) const
 Get the derived value of the unit. More...
 
AMCAX_API bool IsEqual (const AbstructUnit &other, const double tol=1E-12) const
 If the AbstructUnit same as the other AbstructUnit within a tolerance. More...
 
AMCAX_API bool IsEqualE (const AbstructUnit &other) const
 If the AbstructUnit same as the other AbstructUnit within the epsilon. More...
 

Detailed Description

Class for SI Base Units.

Constructor & Destructor Documentation

◆ LengthUnit() [1/5]

AMCAX_API AMCAX::LengthUnit::LengthUnit ( const LengthUnitType  type)

Construct a new LengthUnit object with a pre-defined non-SI unit.

Parameters
typeThe predefined non-SI unit

◆ LengthUnit() [2/5]

AMCAX_API AMCAX::LengthUnit::LengthUnit ( const double  multiplication)

Construct a new LengthUnit object with a multiplication.

Parameters
multiplicationHow many base units are in the multiplication unit
Note
This constructor should only be used to create a non-SI unit

◆ LengthUnit() [3/5]

AMCAX_API AMCAX::LengthUnit::LengthUnit ( const UnitPrefix prefix)

Construct a new LengthUnit object with a prefix.

Parameters
prefixThe prefix of the unit

◆ LengthUnit() [4/5]

AMCAX_API AMCAX::LengthUnit::LengthUnit ( const LengthUnit unit)

Copy constructor.

Parameters
otherThe other LengthUnit object

◆ LengthUnit() [5/5]

AMCAX_API AMCAX::LengthUnit::LengthUnit ( const LengthUnit &&  unit)
noexcept

Move constructor.

Parameters
otherThe other LengthUnit object

Member Function Documentation

◆ operator!=()

AMCAX_API bool AMCAX::LengthUnit::operator!= ( const LengthUnit other) const

If the LengthUnit different from the other LengthUnit.

Parameters
otherThe other LengthUnit to compare with
Returns
True if the LengthUnit is different from the other LengthUnit, false otherwise

◆ operator<()

AMCAX_API bool AMCAX::LengthUnit::operator< ( const LengthUnit other) const

If the LengthUnit less than the other LengthUnit.

Parameters
otherThe other LengthUnit to compare with
Returns
True if the LengthUnit is less than the other LengthUnit, false otherwise

◆ operator<=()

AMCAX_API bool AMCAX::LengthUnit::operator<= ( const LengthUnit other) const

If the LengthUnit less than or equal to the other LengthUnit.

Parameters
otherThe other LengthUnit to compare with
Returns
True if the LengthUnit is less than or equal to the other LengthUnit, false otherwise

◆ operator=() [1/2]

AMCAX_API LengthUnit & AMCAX::LengthUnit::operator= ( const LengthUnit &&  unit)
noexcept

Move assignment operator.

Parameters
otherThe other LengthUnit object
Returns
The LengthUnit object

◆ operator=() [2/2]

AMCAX_API LengthUnit & AMCAX::LengthUnit::operator= ( const LengthUnit unit)

Copy assignment operator.

Parameters
otherThe other LengthUnit object
Returns
The LengthUnit object

◆ operator==()

AMCAX_API bool AMCAX::LengthUnit::operator== ( const LengthUnit other) const

If the LengthUnit same as the other LengthUnit.

Parameters
otherThe other LengthUnit to compare with
Returns
True if the LengthUnit is the same as the other LengthUnit, false otherwise

◆ operator>()

AMCAX_API bool AMCAX::LengthUnit::operator> ( const LengthUnit other) const

If the LengthUnit greater than the other LengthUnit.

Parameters
otherThe other LengthUnit to compare with
Returns
True if the LengthUnit is greater than the other LengthUnit, false otherwise

◆ operator>=()

AMCAX_API bool AMCAX::LengthUnit::operator>= ( const LengthUnit other) const

If the LengthUnit greater than or equal to the other LengthUnit.

Parameters
otherThe other LengthUnit to compare with
Returns
True if the LengthUnit is greater than or equal to the other LengthUnit, false otherwise

◆ SetMultiplication()

AMCAX_API LengthUnit & AMCAX::LengthUnit::SetMultiplication ( const double  multiplication)

Set the multiplication of the unit.

Parameters
multiplicationHow many base units are in the multiplication unit
Returns
The LengthUnit object

◆ SetPrefix()

AMCAX_API LengthUnit & AMCAX::LengthUnit::SetPrefix ( const UnitPrefix  prefix)

Set the prefix of the unit.

Parameters
prefixThe prefix of the unit
Returns
The LengthUnit object

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