COMMS
Template library intended to help with implementation of communication protocols.
|
This file contains all the functions required for proper units conversion. More...
#include <ratio>
#include <type_traits>
#include "comms/CompileControl.h"
#include "comms/traits.h"
#include "comms/util/type_traits.h"
#include "comms/details/tag.h"
Go to the source code of this file.
Namespaces | |
namespace | comms |
Main namespace for all classes / functions of COMMS library. | |
namespace | comms::units |
Namespace containing units conversion operations. | |
Functions | |
template<typename TRet , typename TField > | |
TRet | comms::units::getAmps (const TField &field) |
Retrieve field's value as amps. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getBytes (const TField &field) |
Retrieve field's value as bytes. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getCentimeters (const TField &field) |
Retrieve field's value as centimeters. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getCentimetersPerSecond (const TField &field) |
Retrieve field's value as centimeters per second. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getDays (const TField &field) |
Retrieve field's value as days. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getDegrees (const TField &field) |
Retrieve field's value as degrees. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getGigabytes (const TField &field) |
Retrieve field's value as gigabytes. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getGigahertz (const TField &field) |
Retrieve field's value as gigahertz. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getHertz (const TField &field) |
Retrieve field's value as hertz. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getHours (const TField &field) |
Retrieve field's value as hours. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getKiloamps (const TField &field) |
Retrieve field's value as kiloamps. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getKilobytes (const TField &field) |
Retrieve field's value as kilobytes. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getKilohertz (const TField &field) |
Retrieve field's value as kilohertz. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getKilometers (const TField &field) |
Retrieve field's value as kilometers. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getKilometersPerHour (const TField &field) |
Retrieve field's value as kilometers per hour. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getKilometersPerSecond (const TField &field) |
Retrieve field's value as kilometers per second. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getKilovolts (const TField &field) |
Retrieve field's value as kilovolts. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMegabytes (const TField &field) |
Retrieve field's value as megabytes. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMegahertz (const TField &field) |
Retrieve field's value as megahertz. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMeters (const TField &field) |
Retrieve field's value as meters. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMetersPerSecond (const TField &field) |
Retrieve field's value as meters per second. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMicroamps (const TField &field) |
Retrieve field's value as microamps. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMicrometers (const TField &field) |
Retrieve field's value as micrometers. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMicrometersPerSecond (const TField &field) |
Retrieve field's value as micrometers per second. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMicroseconds (const TField &field) |
Retrieve field's value as microseconds. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMicrovolts (const TField &field) |
Retrieve field's value as microvolts. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMilliamps (const TField &field) |
Retrieve field's value as milliamps. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMillimeters (const TField &field) |
Retrieve field's value as millimeters. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMillimetersPerSecond (const TField &field) |
Retrieve field's value as millimeters per second. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMilliseconds (const TField &field) |
Retrieve field's value as milliseconds. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMillivolts (const TField &field) |
Retrieve field's value as millivolts. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getMinutes (const TField &field) |
Retrieve field's value as minutes. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getNanoamps (const TField &field) |
Retrieve field's value as nanoamps. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getNanometers (const TField &field) |
Retrieve field's value as nanometers. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getNanometersPerSecond (const TField &field) |
Retrieve field's value as nanometers per second. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getNanoseconds (const TField &field) |
Retrieve field's value as nanoseconds. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getNanovolts (const TField &field) |
Retrieve field's value as nanovolts. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getRadians (const TField &field) |
Retrieve field's value as radians. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getSeconds (const TField &field) |
Retrieve field's value as seconds. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getTerabytes (const TField &field) |
Retrieve field's value as terabytes. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getVolts (const TField &field) |
Retrieve field's value as volts. | |
template<typename TRet , typename TField > | |
TRet | comms::units::getWeeks (const TField &field) |
Retrieve field's value as weeks. | |
template<typename TField > | |
constexpr bool | comms::units::isAmps () |
Compile time check whether the field type holds amps. | |
template<typename TField > | |
constexpr bool | comms::units::isAmps (const TField &field) |
Compile time check whether the field type holds amps. | |
template<typename TField > | |
constexpr bool | comms::units::isBytes () |
Compile time check whether the field type holds bytes. | |
template<typename TField > | |
constexpr bool | comms::units::isBytes (const TField &field) |
Compile time check whether the field type holds bytes. | |
template<typename TField > | |
constexpr bool | comms::units::isCentimeters () |
Compile time check whether the field type holds centimeters. | |
template<typename TField > | |
constexpr bool | comms::units::isCentimeters (const TField &field) |
Compile time check whether the field type holds centimeters. | |
template<typename TField > | |
constexpr bool | comms::units::isCentimetersPerSecond () |
Compile time check whether the field type holds centimeters per second. | |
template<typename TField > | |
constexpr bool | comms::units::isCentimetersPerSecond (const TField &field) |
Compile time check whether the field type holds centimeters per second. | |
template<typename TField > | |
constexpr bool | comms::units::isDays () |
Compile time check whether the field type holds days. | |
template<typename TField > | |
constexpr bool | comms::units::isDays (const TField &field) |
Compile time check whether the field type holds days. | |
template<typename TField > | |
constexpr bool | comms::units::isDegrees () |
Compile time check whether the field type holds degrees. | |
template<typename TField > | |
constexpr bool | comms::units::isDegrees (const TField &field) |
Compile time check whether the field type holds degrees. | |
template<typename TField > | |
constexpr bool | comms::units::isGigabytes () |
Compile time check whether the field type holds gigabytes. | |
template<typename TField > | |
constexpr bool | comms::units::isGigabytes (const TField &field) |
Compile time check whether the field type holds gigabytes. | |
template<typename TField > | |
constexpr bool | comms::units::isGigahertz () |
Compile time check whether the field type holds gigahertz. | |
template<typename TField > | |
constexpr bool | comms::units::isGigahertz (const TField &field) |
Compile time check whether the field type holds gigahertz. | |
template<typename TField > | |
constexpr bool | comms::units::isHertz () |
Compile time check whether the field type holds hertz. | |
template<typename TField > | |
constexpr bool | comms::units::isHertz (const TField &field) |
Compile time check whether the field type holds hertz. | |
template<typename TField > | |
constexpr bool | comms::units::isHours () |
Compile time check whether the field type holds hours. | |
template<typename TField > | |
constexpr bool | comms::units::isHours (const TField &field) |
Compile time check whether the field type holds hours. | |
template<typename TField > | |
constexpr bool | comms::units::isKiloamps () |
Compile time check whether the field type holds kiloamps. | |
template<typename TField > | |
constexpr bool | comms::units::isKiloamps (const TField &field) |
Compile time check whether the field type holds kiloamps. | |
template<typename TField > | |
constexpr bool | comms::units::isKilobytes () |
Compile time check whether the field type holds kilobytes. | |
template<typename TField > | |
constexpr bool | comms::units::isKilobytes (const TField &field) |
Compile time check whether the field type holds kilobytes. | |
template<typename TField > | |
constexpr bool | comms::units::isKilohertz () |
Compile time check whether the field type holds kilohertz. | |
template<typename TField > | |
constexpr bool | comms::units::isKilohertz (const TField &field) |
Compile time check whether the field type holds kilohertz. | |
template<typename TField > | |
constexpr bool | comms::units::isKilometers () |
Compile time check whether the field type holds kilometers. | |
template<typename TField > | |
constexpr bool | comms::units::isKilometers (const TField &field) |
Compile time check whether the field type holds kilometers. | |
template<typename TField > | |
constexpr bool | comms::units::isKilometersPerHour () |
Compile time check whether the field type holds kilometers per hour. | |
template<typename TField > | |
constexpr bool | comms::units::isKilometersPerHour (const TField &field) |
Compile time check whether the field type holds kilometers per hour. | |
template<typename TField > | |
constexpr bool | comms::units::isKilometersPerSecond () |
Compile time check whether the field type holds kilometers per second. | |
template<typename TField > | |
constexpr bool | comms::units::isKilometersPerSecond (const TField &field) |
Compile time check whether the field type holds kilometers per second. | |
template<typename TField > | |
constexpr bool | comms::units::isKilovolts () |
Compile time check whether the field type holds kilovolts. | |
template<typename TField > | |
constexpr bool | comms::units::isKilovolts (const TField &field) |
Compile time check whether the field type holds kilovolts. | |
template<typename TField > | |
constexpr bool | comms::units::isMegabytes () |
Compile time check whether the field type holds megabytes. | |
template<typename TField > | |
constexpr bool | comms::units::isMegabytes (const TField &field) |
Compile time check whether the field type holds megabytes. | |
template<typename TField > | |
constexpr bool | comms::units::isMegahertz () |
Compile time check whether the field type holds megahertz. | |
template<typename TField > | |
constexpr bool | comms::units::isMegahertz (const TField &field) |
Compile time check whether the field type holds megahertz. | |
template<typename TField > | |
constexpr bool | comms::units::isMeters () |
Compile time check whether the field type holds meters. | |
template<typename TField > | |
constexpr bool | comms::units::isMeters (const TField &field) |
Compile time check whether the field type holds meters. | |
template<typename TField > | |
constexpr bool | comms::units::isMetersPerSecond () |
Compile time check whether the field type holds meters per second. | |
template<typename TField > | |
constexpr bool | comms::units::isMetersPerSecond (const TField &field) |
Compile time check whether the field type holds meters per second. | |
template<typename TField > | |
constexpr bool | comms::units::isMicroamps () |
Compile time check whether the field type holds microamps. | |
template<typename TField > | |
constexpr bool | comms::units::isMicroamps (const TField &field) |
Compile time check whether the field type holds microamps. | |
template<typename TField > | |
constexpr bool | comms::units::isMicrometers () |
Compile time check whether the field type holds micrometers. | |
template<typename TField > | |
constexpr bool | comms::units::isMicrometers (const TField &field) |
Compile time check whether the field type holds micrometers. | |
template<typename TField > | |
constexpr bool | comms::units::isMicrometersPerSecond () |
Compile time check whether the field type holds micrometers per second. | |
template<typename TField > | |
constexpr bool | comms::units::isMicrometersPerSecond (const TField &field) |
Compile time check whether the field type holds micrometers per second. | |
template<typename TField > | |
constexpr bool | comms::units::isMicroseconds () |
Compile time check whether the field type holds microseconds. | |
template<typename TField > | |
constexpr bool | comms::units::isMicroseconds (const TField &field) |
Compile time check whether the field type holds microseconds. | |
template<typename TField > | |
constexpr bool | comms::units::isMicrovolts () |
Compile time check whether the field type holds microvolts. | |
template<typename TField > | |
constexpr bool | comms::units::isMicrovolts (const TField &field) |
Compile time check whether the field type holds microvolts. | |
template<typename TField > | |
constexpr bool | comms::units::isMilliamps () |
Compile time check whether the field type holds milliamps. | |
template<typename TField > | |
constexpr bool | comms::units::isMilliamps (const TField &field) |
Compile time check whether the field type holds milliamps. | |
template<typename TField > | |
constexpr bool | comms::units::isMillimeters () |
Compile time check whether the field type holds millimeters. | |
template<typename TField > | |
constexpr bool | comms::units::isMillimeters (const TField &field) |
Compile time check whether the field type holds millimeters. | |
template<typename TField > | |
constexpr bool | comms::units::isMillimetersPerSecond () |
Compile time check whether the field type holds millimeters per second. | |
template<typename TField > | |
constexpr bool | comms::units::isMillimetersPerSecond (const TField &field) |
Compile time check whether the field type holds millimeters per second. | |
template<typename TField > | |
constexpr bool | comms::units::isMilliseconds () |
Compile time check whether the field type holds milliseconds. | |
template<typename TField > | |
constexpr bool | comms::units::isMilliseconds (const TField &field) |
Compile time check whether the field type holds milliseconds. | |
template<typename TField > | |
constexpr bool | comms::units::isMillivolts () |
Compile time check whether the field type holds millivolts. | |
template<typename TField > | |
constexpr bool | comms::units::isMillivolts (const TField &field) |
Compile time check whether the field type holds millivolts. | |
template<typename TField > | |
constexpr bool | comms::units::isMinutes () |
Compile time check whether the field type holds minutes. | |
template<typename TField > | |
constexpr bool | comms::units::isMinutes (const TField &field) |
Compile time check whether the field type holds minutes. | |
template<typename TField > | |
constexpr bool | comms::units::isNanoamps () |
Compile time check whether the field type holds nanoamps. | |
template<typename TField > | |
constexpr bool | comms::units::isNanoamps (const TField &field) |
Compile time check whether the field type holds nanoamps. | |
template<typename TField > | |
constexpr bool | comms::units::isNanometers () |
Compile time check whether the field type holds nanometers. | |
template<typename TField > | |
constexpr bool | comms::units::isNanometers (const TField &field) |
Compile time check whether the field type holds nanometers. | |
template<typename TField > | |
constexpr bool | comms::units::isNanometersPerSecond () |
Compile time check whether the field type holds nanometers per second. | |
template<typename TField > | |
constexpr bool | comms::units::isNanometersPerSecond (const TField &field) |
Compile time check whether the field type holds nanometers per second. | |
template<typename TField > | |
constexpr bool | comms::units::isNanoseconds () |
Compile time check whether the field type holds nanoseconds. | |
template<typename TField > | |
constexpr bool | comms::units::isNanoseconds (const TField &field) |
Compile time check whether the field type holds nanoseconds. | |
template<typename TField > | |
constexpr bool | comms::units::isNanovolts () |
Compile time check whether the field type holds nanovolts. | |
template<typename TField > | |
constexpr bool | comms::units::isNanovolts (const TField &field) |
Compile time check whether the field type holds nanovolts. | |
template<typename TField > | |
constexpr bool | comms::units::isRadians () |
Compile time check whether the field type holds radians. | |
template<typename TField > | |
constexpr bool | comms::units::isRadians (const TField &field) |
Compile time check whether the field type holds radia s. | |
template<typename TField > | |
constexpr bool | comms::units::isSeconds () |
Compile time check whether the field type holds seconds. | |
template<typename TField > | |
constexpr bool | comms::units::isSeconds (const TField &field) |
Compile time check whether the field type holds seconds. | |
template<typename TField > | |
constexpr bool | comms::units::isTerabytes () |
Compile time check whether the field type holds terabytes. | |
template<typename TField > | |
constexpr bool | comms::units::isTerabytes (const TField &field) |
Compile time check whether the field type holds terabytes. | |
template<typename TField > | |
constexpr bool | comms::units::isVolts () |
Compile time check whether the field type holds volts. | |
template<typename TField > | |
constexpr bool | comms::units::isVolts (const TField &field) |
Compile time check whether the field type holds volts. | |
template<typename TField > | |
constexpr bool | comms::units::isWeeks () |
Compile time check whether the field type holds weeks. | |
template<typename TField > | |
constexpr bool | comms::units::isWeeks (const TField &field) |
Compile time check whether the field type holds weeks. | |
template<typename TField , typename TVal > | |
void | comms::units::setAmps (TField &field, TVal &&val) |
Update field's value accordingly, while providing amps value. | |
template<typename TField , typename TVal > | |
void | comms::units::setBytes (TField &field, TVal &&val) |
Update field's value accordingly, while providing bytes value. | |
template<typename TField , typename TVal > | |
void | comms::units::setCentimeters (TField &field, TVal &&val) |
Update field's value accordingly, while providing centimeters value. | |
template<typename TField , typename TVal > | |
void | comms::units::setCentimetersPerSecond (TField &field, TVal &&val) |
Update field's value accordingly, while providing centimeters per second value. | |
template<typename TField , typename TVal > | |
void | comms::units::setDays (TField &field, TVal &&val) |
Update field's value accordingly, while providing days value. | |
template<typename TField , typename TVal > | |
void | comms::units::setDegrees (TField &field, TVal &&val) |
Update field's value accordingly, while providing degrees value. | |
template<typename TField , typename TVal > | |
void | comms::units::setGigabytes (TField &field, TVal &&val) |
Update field's value accordingly, while providing gigabytes value. | |
template<typename TField , typename TVal > | |
void | comms::units::setGigahertz (TField &field, TVal &&val) |
Update field's value accordingly, while providing gigahertz value. | |
template<typename TField , typename TVal > | |
void | comms::units::setHertz (TField &field, TVal &&val) |
Update field's value accordingly, while providing hertz value. | |
template<typename TField , typename TVal > | |
void | comms::units::setHours (TField &field, TVal &&val) |
Update field's value accordingly, while providing hours value. | |
template<typename TField , typename TVal > | |
void | comms::units::setKiloamps (TField &field, TVal &&val) |
Update field's value accordingly, while providing kiloamps value. | |
template<typename TField , typename TVal > | |
void | comms::units::setKilobytes (TField &field, TVal &&val) |
Update field's value accordingly, while providing kilobytes value. | |
template<typename TField , typename TVal > | |
void | comms::units::setKilohertz (TField &field, TVal &&val) |
Update field's value accordingly, while providing kilohertz value. | |
template<typename TField , typename TVal > | |
void | comms::units::setKilometers (TField &field, TVal &&val) |
Update field's value accordingly, while providing kilometers value. | |
template<typename TField , typename TVal > | |
void | comms::units::setKilometersPerHour (TField &field, TVal &&val) |
Update field's value accordingly, while providing kilometers per hour value. | |
template<typename TField , typename TVal > | |
void | comms::units::setKilometersPerSecond (TField &field, TVal &&val) |
Update field's value accordingly, while providing kilometers per second value. | |
template<typename TField , typename TVal > | |
void | comms::units::setKilovolts (TField &field, TVal &&val) |
Update field's value accordingly, while providing kilovolts value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMegabytes (TField &field, TVal &&val) |
Update field's value accordingly, while providing megabytes value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMegahertz (TField &field, TVal &&val) |
Update field's value accordingly, while providing megahertz value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMeters (TField &field, TVal &&val) |
Update field's value accordingly, while providing meters value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMetersPerSecond (TField &field, TVal &&val) |
Update field's value accordingly, while providing meters per second value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMicroamps (TField &field, TVal &&val) |
Update field's value accordingly, while providing microamps value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMicrometers (TField &field, TVal &&val) |
Update field's value accordingly, while providing micrometers value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMicrometersPerSecond (TField &field, TVal &&val) |
Update field's value accordingly, while providing micrometers per second value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMicroseconds (TField &field, TVal &&val) |
Update field's value accordingly, while providing microseconds value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMicrovolts (TField &field, TVal &&val) |
Update field's value accordingly, while providing microvolts value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMilliamps (TField &field, TVal &&val) |
Update field's value accordingly, while providing milliamps value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMillimeters (TField &field, TVal &&val) |
Update field's value accordingly, while providing millimeters value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMillimetersPerSecond (TField &field, TVal &&val) |
Update field's value accordingly, while providing millimeters per second value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMilliseconds (TField &field, TVal &&val) |
Update field's value accordingly, while providing milliseconds value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMillivolts (TField &field, TVal &&val) |
Update field's value accordingly, while providing millivolts value. | |
template<typename TField , typename TVal > | |
void | comms::units::setMinutes (TField &field, TVal &&val) |
Update field's value accordingly, while providing minutes value. | |
template<typename TField , typename TVal > | |
void | comms::units::setNanoamps (TField &field, TVal &&val) |
Update field's value accordingly, while providing nanoamps value. | |
template<typename TField , typename TVal > | |
void | comms::units::setNanometers (TField &field, TVal &&val) |
Update field's value accordingly, while providing nanometers value. | |
template<typename TField , typename TVal > | |
void | comms::units::setNanometersPerSecond (TField &field, TVal &&val) |
Update field's value accordingly, while providing nanometers per second value. | |
template<typename TField , typename TVal > | |
void | comms::units::setNanoseconds (TField &field, TVal &&val) |
Update field's value accordingly, while providing nanoseconds value. | |
template<typename TField , typename TVal > | |
void | comms::units::setNanovolts (TField &field, TVal &&val) |
Update field's value accordingly, while providing nanovolts value. | |
template<typename TField , typename TVal > | |
void | comms::units::setRadians (TField &field, TVal &&val) |
Update field's value accordingly, while providing radians value. | |
template<typename TField , typename TVal > | |
void | comms::units::setSeconds (TField &field, TVal &&val) |
Update field's value accordingly, while providing seconds value. | |
template<typename TField , typename TVal > | |
void | comms::units::setTerabytes (TField &field, TVal &&val) |
Update field's value accordingly, while providing terabytes value. | |
template<typename TField , typename TVal > | |
void | comms::units::setVolts (TField &field, TVal &&val) |
Update field's value accordingly, while providing volts value. | |
template<typename TField , typename TVal > | |
void | comms::units::setWeeks (TField &field, TVal &&val) |
Update field's value accordingly, while providing weeks value. | |
This file contains all the functions required for proper units conversion.