🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
ast::Unit类 参考

#include <Unit.hpp>

Public 成员函数

 Unit ()
 
AST_UTIL_API Unit (StringView name)
 
 Unit (StringView name, double scale, Dimension dimension)
 
double fromSI (double value) const
 
double toSI (double value) const
 
double convertTo (double value, const Unit &unit) const
 
double convertFrom (double value, const Unit &unit) const
 
double getScale () const
 
Dimension dimension () const
 
const std::string & name () const
 
EUnitKind kind () const
 
bool isValid () const
 
Unit clone () const
 
Unit invert () const
 
Unit multiply (StringView newname, const Unit &other) const
 
Unit divide (StringView newname, const Unit &other) const
 
Unit pow (StringView newname, int exponent) const
 
Unit pow (int exponent) const
 
bool operator== (const Unit &other) const
 
bool operator!= (const Unit &other) const
 
Unit operator* (const Unit &other) const
 
Unit operator/ (const Unit &other) const
 
Unitoperator*= (const Unit &other)
 
Unitoperator/= (const Unit &other)
 

静态 Public 成员函数

static AST_UTIL_API Unit MakeScale (StringView name, Dimension dim, double scale)
 
static AST_UTIL_API Unit MakeAffine (StringView name, Dimension dim, double scale, double offset)
 
static AST_UTIL_API Unit MakeLogarithmic (StringView name, Dimension dim, double reference, double factor)
 
static Unit NaN ()
 
static Unit None ()
 
static Unit One ()
 
static AST_UTIL_API Unit Scale (double scale)
 
static Unit Percent ()
 
static Unit Second ()
 
static Unit Minute ()
 
static Unit Hour ()
 
static Unit Day ()
 
static Unit MilliSecond ()
 
static Unit Meter ()
 
static Unit Kilometer ()
 
static Unit Centimeter ()
 
static Unit Decimeter ()
 
static Unit Millimeter ()
 
static Unit Inch ()
 
static Unit Foot ()
 
static Unit Yard ()
 
static Unit Mile ()
 
static Unit Kilogram ()
 
static Unit Gram ()
 
static Unit Milligram ()
 
static Unit Pound ()
 
static Unit Radian ()
 
static Unit Degree ()
 
static Unit ArcSecond ()
 
static Unit Newton ()
 
static Unit Ampere ()
 
static Unit Kelvin ()
 
static Unit Celsius ()
 
static Unit Fahrenheit ()
 
static Unit Rankine ()
 
static Unit Decibel ()
 
static Unit DecibelMilliwatt ()
 
static Unit DecibelWatt ()
 
static Unit Bel ()
 
static Unit CentimeterPerSecond ()
 
static Unit KilometerPerHour ()
 
static Unit MeterPerMinute ()
 
static Unit SquareMeter ()
 
static Unit SquareKilometer ()
 
static Unit SquareFoot ()
 
static Unit SquareYard ()
 
static Unit CubicMeter ()
 
static Unit Liter ()
 
static Unit Pascal ()
 
static Unit Tesla ()
 
static Unit NanoTesla ()
 
static Unit Gauss ()
 

Public 属性

UnitRepHandle rep_ {}
 

Protected 成员函数

 Unit (double scale, Dimension dimension, const SubUnitListConst &subunits)
 
 Unit (UnitRepHandle rep)
 

详细描述

单位

构造及析构函数说明

◆ Unit()

ast::Unit::Unit ( UnitRepHandle rep)
inlineprotected
参数
rep单位表示

成员函数说明

◆ CentimeterPerSecond()

static Unit ast::Unit::CentimeterPerSecond ( )
inlinestatic

mole单位

厘米每秒单位

◆ clone()

Unit ast::Unit::clone ( ) const
inline

单位克隆

返回
新单位(独立副本,与源单位共享底层子单位但顶层表示可独立修改)

◆ convertFrom()

double ast::Unit::convertFrom ( double value,
const Unit & unit ) const
inline

从指定单位下的值转换为此单位对应的值

参数
value指定单位下的值
unit指定单位
返回
此单位对应的值

◆ convertTo()

double ast::Unit::convertTo ( double value,
const Unit & unit ) const
inline

转换为指定单位下的值

参数
value此单位对应的值
unit指定单位
返回
指定单位下的值

◆ dimension()

Dimension ast::Unit::dimension ( ) const
inline

获取单位量纲

返回
单位量纲

◆ divide()

Unit ast::Unit::divide ( StringView newname,
const Unit & other ) const
inline

单位除法

参数
newname新单位名称
other其他单位
返回
新单位

◆ fromSI()

double ast::Unit::fromSI ( double value) const
inline

从国际单位制转换为此单位对应的值

参数
value国际单位制下的值
返回
外部值

◆ getScale()

double ast::Unit::getScale ( ) const
inline

获取单位缩放因子

返回
单位缩放因子

◆ isValid()

bool ast::Unit::isValid ( ) const
inline

是否有效单位

返回
是否有效单位

◆ kind()

EUnitKind ast::Unit::kind ( ) const
inline

获取单位类型

返回
单位类型

◆ MakeAffine()

Unit ast::Unit::MakeAffine ( StringView name,
Dimension dim,
double scale,
double offset )
static

创建仿射型单位

参数
name名称
dim量纲
scale缩放因子
offset偏移量

◆ MakeLogarithmic()

Unit ast::Unit::MakeLogarithmic ( StringView name,
Dimension dim,
double reference,
double factor )
static

创建对数型单位

参数
name名称
dim量纲
reference对数参考值
factor对数因子

◆ MakeScale()

Unit ast::Unit::MakeScale ( StringView name,
Dimension dim,
double scale )
static

创建乘法型单位

参数
name名称
dim量纲
scale缩放因子

◆ multiply()

Unit ast::Unit::multiply ( StringView newname,
const Unit & other ) const
inline

单位乘法

参数
newname新单位名称
other其他单位
返回
新单位

◆ name()

const std::string & ast::Unit::name ( ) const
inline

获取单位名称

返回
单位名称

◆ operator!=()

bool ast::Unit::operator!= ( const Unit & other) const
inline

单位不相等运算符

参数
other其他单位
返回
是否不相等

◆ operator*()

Unit ast::Unit::operator* ( const Unit & other) const
inline

单位乘法运算符

参数
other其他单位
返回
新单位

◆ operator*=()

Unit & ast::Unit::operator*= ( const Unit & other)
inline

单位乘法赋值运算符

参数
other其他单位
返回
新单位

◆ operator/()

Unit ast::Unit::operator/ ( const Unit & other) const
inline

单位除法运算符

参数
other其他单位
返回
新单位

◆ operator/=()

Unit & ast::Unit::operator/= ( const Unit & other)
inline

单位除法赋值运算符

参数
other其他单位
返回
新单位

◆ operator==()

bool ast::Unit::operator== ( const Unit & other) const
inline

单位相等运算符

参数
other其他单位
返回
是否相等

◆ pow() [1/2]

Unit ast::Unit::pow ( int exponent) const
inline

单位幂运算

参数
exponent指数
返回
新单位

◆ pow() [2/2]

Unit ast::Unit::pow ( StringView newname,
int exponent ) const
inline

单位幂运算

参数
newname新单位名称
exponent指数
返回
新单位

◆ Scale()

Unit ast::Unit::Scale ( double scale)
static

新建无量纲单位

参数
scale缩放因子
返回
单位表示

◆ toSI()

double ast::Unit::toSI ( double value) const
inline

从此单位对应的值转换为国际单位制下的值

参数
value此单位对应的值
返回
国际单位制下的值

该类的文档由以下文件生成: