AMCAX Kernel 1.0.0.0
AMCAX::TimeUnit Class Reference

Class for SI Base Units. More...

#include <misc/TimeUnit.hpp>

Inheritance diagram for AMCAX::TimeUnit:
Collaboration diagram for AMCAX::TimeUnit:

Public Member Functions

AMCAX_API TimeUnit ()
 Default constructor.
 
AMCAX_API TimeUnit (const TimeUnitType type)
 Construct a new TimeUnit object with a pre-defined non-SI unit. More...
 
AMCAX_API TimeUnit (const double multiplication)
 Construct a new TimeUnit object with a multiplication. More...
 
AMCAX_API TimeUnit (const UnitPrefix &prefix)
 Construct a new TimeUnit object with a prefix. More...
 
AMCAX_API TimeUnit (const TimeUnit &unit)
 Copy constructor. More...
 
AMCAX_API TimeUnit (const TimeUnit &&unit) noexcept
 Move constructor. More...
 
AMCAX_API TimeUnitoperator= (const TimeUnit &unit)
 Copy assignment operator. More...
 
AMCAX_API TimeUnitoperator= (const TimeUnit &&unit) noexcept
 Move assignment operator. More...
 
AMCAX_API ~TimeUnit () override
 Destructor.
 
AMCAX_API TimeUnitSetPrefix (const UnitPrefix prefix)
 Set the prefix of the unit. More...
 
AMCAX_API TimeUnitSetMultiplication (const double multiplication)
 Set the multiplication of the unit. More...
 
AMCAX_API bool operator== (const TimeUnit &other) const
 If the TimeUnit same as the other TimeUnit. More...
 
AMCAX_API bool operator!= (const TimeUnit &other) const
 If the TimeUnit different from the other TimeUnit. More...
 
AMCAX_API bool operator< (const TimeUnit &other) const
 If the TimeUnit less than the other TimeUnit. More...
 
AMCAX_API bool operator> (const TimeUnit &other) const
 If the TimeUnit greater than the other TimeUnit. More...
 
AMCAX_API bool operator<= (const TimeUnit &other) const
 If the TimeUnit less than or equal to the other TimeUnit. More...
 
AMCAX_API bool operator>= (const TimeUnit &other) const
 If the TimeUnit greater than or equal to the other TimeUnit. More...
 
AMCAX_API TimeUnitUseSecond ()
 Use the second unit.
 
AMCAX_API TimeUnitUseMinute ()
 Use the minute unit.
 
AMCAX_API TimeUnitUseHour ()
 Use the hour unit.
 
- 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

◆ TimeUnit() [1/5]

AMCAX_API AMCAX::TimeUnit::TimeUnit ( const TimeUnitType  type)

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

Parameters
typeThe predefined non-SI unit

◆ TimeUnit() [2/5]

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

Construct a new TimeUnit 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

◆ TimeUnit() [3/5]

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

Construct a new TimeUnit object with a prefix.

Parameters
prefixThe prefix of the unit

◆ TimeUnit() [4/5]

AMCAX_API AMCAX::TimeUnit::TimeUnit ( const TimeUnit unit)

Copy constructor.

Parameters
otherThe other TimeUnit object

◆ TimeUnit() [5/5]

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

Move constructor.

Parameters
otherThe other TimeUnit object

Member Function Documentation

◆ operator!=()

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

If the TimeUnit different from the other TimeUnit.

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

◆ operator<()

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

If the TimeUnit less than the other TimeUnit.

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

◆ operator<=()

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

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

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

◆ operator=() [1/2]

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

Move assignment operator.

Parameters
otherThe other TimeUnit object
Returns
The TimeUnit object

◆ operator=() [2/2]

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

Copy assignment operator.

Parameters
otherThe other TimeUnit object
Returns
The TimeUnit object

◆ operator==()

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

If the TimeUnit same as the other TimeUnit.

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

◆ operator>()

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

If the TimeUnit greater than the other TimeUnit.

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

◆ operator>=()

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

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

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

◆ SetMultiplication()

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

Set the multiplication of the unit.

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

◆ SetPrefix()

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

Set the prefix of the unit.

Parameters
prefixThe prefix of the unit
Returns
The TimeUnit object

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