engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Public 属性 | 所有成员列表
FNumericUnit< NumericType > 模板结构体 参考

FNumericUnit is a numeric type that wraps the templated type, whilst a specified unit. 更多...

#include <UnitConversion.h>

Public 成员函数

TOptional< FNumericUnit< NumericType > > ConvertTo (EUnit ToUnits) const
 Convert this quantity to a different unit
 
 FNumericUnit ()
 Constructors
 
 FNumericUnit (const FNumericUnit &Other)
 Copy construction/assignment from the same type
 
template<typename OtherType >
 FNumericUnit (const FNumericUnit< OtherType > &Other)
 Templated Copy construction/assignment from differing numeric types. 更多...
 
FNumericUnit< NumericType > QuantizeUnitsToBestFit () const
 Quantizes this number to the most appropriate unit for user friendly presentation (e.g. 更多...
 

静态 Public 成员函数

static TValueOrError< FNumericUnit< NumericType >, FText > TryParseExpression (const TCHAR *InExpression, EUnit InDefaultUnit, const FNumericUnit< NumericType > &InExistingValue)
 Try and parse an expression into a numeric unit
 
static TOptional< FNumericUnit< NumericType > > TryParseString (const TCHAR *InSource)
 Parse a numeric unit from a string
 

Public 属性

const EUnit Units
 The associated units for the value. 更多...
 
NumericType Value
 The numeric (scalar) value
 

详细描述

template<typename NumericType>
struct FNumericUnit< NumericType >

FNumericUnit is a numeric type that wraps the templated type, whilst a specified unit.

It handles conversion to/from related units automatically. The units are considered not to contribute to the type's state, and as such should be considered immutable once set.

构造及析构函数说明

◆ FNumericUnit()

template<typename NumericType >
template<typename OtherType >
FNumericUnit< NumericType >::FNumericUnit ( const FNumericUnit< OtherType > &  Other)

Templated Copy construction/assignment from differing numeric types.

Relies on implicit conversion of the two numeric types.

成员函数说明

◆ QuantizeUnitsToBestFit()

template<typename NumericType >
FNumericUnit< NumericType > FNumericUnit< NumericType >::QuantizeUnitsToBestFit ( ) const

Quantizes this number to the most appropriate unit for user friendly presentation (e.g.

1000m returns 1km).

类成员变量说明

◆ Units

template<typename NumericType >
const EUnit FNumericUnit< NumericType >::Units

The associated units for the value.

Can never change once set to anything other than EUnit::Unspecified.


该结构体的文档由以下文件生成: