|
knowL: Knowledge Libraries
|
#include <QuantityValue.h>
Classes | |
| struct | Constructor< _TOther_, std::enable_if_t< not std::is_same_v< _TOther_, QString > > > |
| struct | Constructor< QString > |
Public Member Functions | |
| QuantityValue (const _T_ &_value, const Unit &_unit) | |
| Unit | unit () const |
| _T_ | value () const |
| ReturnValue< QuantityValue > | operator+ (const QuantityValue &_rhs) const |
| ReturnValue< QuantityValue > | operator- (const QuantityValue &_rhs) const |
| ReturnValue< QuantityValue > | operator/ (const QuantityValue &_rhs) const |
| ReturnValue< QuantityValue > | operator* (const QuantityValue &_rhs) const |
| QuantityValue | operator/ (const _T_ &_rhs) const |
| QuantityValue | operator* (const _T_ &_rhs) const |
| bool | operator== (const QuantityValue &_rhs) const |
| ReturnValue< bool > | operator< (const QuantityValue &_rhs) const |
| ReturnValue< QByteArray > | md5 () const |
| ReturnValue< QJsonValue > | toJsonValue (const SerialisationContexts &_contexts=defaultSerialisationContext()) const |
| ReturnValue< QCborValue > | toCborValue (const SerialisationContexts &_contexts=defaultSerialisationContext()) const |
| ReturnValue< QString > | toRdfLiteral (const SerialisationContexts &_contexts=defaultSerialisationContext()) const |
| ReturnValue< QString > | printable () const |
| template<typename _TOther_ , std::enable_if_t< not std::is_base_of_v< Value, _TOther_ >, bool > > | |
| ReturnValue< QuantityValue< _T_ > > | create (const _TOther_ &_value, const knowCore::Uri &_unit_uri) |
| template<typename _TOther_ , std::enable_if_t< not std::is_base_of_v< Value, _TOther_ >, bool > > | |
| ReturnValue< QuantityValue< _T_ > > | create (const _TOther_ &_value, const Symbol &_unit_symbol) |
Static Public Member Functions | |
| template<typename _TOther_ , typename _TUri_ , std::enable_if_t< not std::is_base_of_v< Value, _TOther_ >, bool > = true> | |
| static std::enable_if_t< knowCore::Uris::IsUriDefinitionV< _TUri_ >, ReturnValue< QuantityValue > > | create (const _TOther_ &_value, const _TUri_ &_unit_uri) |
| template<typename _TOther_ , std::enable_if_t< not std::is_base_of_v< Value, _TOther_ >, bool > = true> | |
| static ReturnValue< QuantityValue > | create (const _TOther_ &_value, const knowCore::Uri &_unit_uri) |
| static ReturnValue< QuantityValue > | create (const Value &_value, const knowCore::Uri &_unit_uri) |
| template<typename _TOther_ , std::enable_if_t< not std::is_base_of_v< Value, _TOther_ >, bool > = true> | |
| static ReturnValue< QuantityValue > | create (const _TOther_ &_value, const QString &_unit_uri)=delete |
| static ReturnValue< QuantityValue > | create (const Value &_value, const QString &_unit_uri)=delete |
| template<typename _TOther_ , std::enable_if_t< not std::is_base_of_v< Value, _TOther_ >, bool > = true> | |
| static ReturnValue< QuantityValue > | create (const _TOther_ &_value, const Symbol &_unit_symbol) |
| static ReturnValue< QuantityValue > | create (const Value &_value, const Symbol &_unit_symbol) |
| static ReturnValue< QuantityValue > | fromJsonValue (const QJsonValue &_value, const DeserialisationContexts &_context=defaultDeserialisationContext()) |
| static ReturnValue< QuantityValue > | fromCborValue (const QCborValue &_value, const DeserialisationContexts &_context=defaultDeserialisationContext()) |
| static ReturnValue< QuantityValue > | fromRdfLiteral (const QString &_value, const DeserialisationContexts &_context=defaultDeserialisationContext()) |
This class can be use to combine a number with a Unit. Look at UnitNumber for an alias combining BigNumber with Unit.
|
inlinestatic |
Convert from cbor
|
inlinestatic |
Convert from json
|
inlinestatic |
Convert from a rdf literal (something like "12.0 m/s")
|
inline |
| QuantityValue< _T_ > knowCore::QuantityValue< _T_ >::operator* | ( | const _T_ & | _rhs | ) | const |
Multiplication.
|
inline |
Attempt a multiplication, return an error if units are not compatible
|
inline |
Attempt an addition, return an error if units are not compatible
|
inline |
Attempt an substractionm, return an error if units are not compatible
| QuantityValue< _T_ > knowCore::QuantityValue< _T_ >::operator/ | ( | const _T_ & | _rhs | ) | const |
Division.
|
inline |
Attempt a division, return an error if units are not compatible
| ReturnValue< bool > knowCore::QuantityValue< _T_ >::operator< | ( | const QuantityValue< _T_ > & | _rhs | ) | const |
Compare two values for inferirority. It will return an error if the units are not compatible.
| bool knowCore::QuantityValue< _T_ >::operator== | ( | const QuantityValue< _T_ > & | _rhs | ) | const |
Compare two values. Note, that comparing two numbers with different unit is acceptable and will return false.
|
inline |
Return a printable value
|
inline |
Convert to cbor
|
inline |
Convert to json
|
inline |
Convert to a rdf literal (something like "12.0 m/s")
|
inline |
|
inline |