🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
ValQuantity.hpp
浏览该文件的文档.
1
20
21
#pragma once
22
23
#include "AstGlobal.h"
24
#include "AstScript/Value.hpp"
25
#include "AstUtil/Quantity.hpp"
26
27
AST_NAMESPACE_BEGIN
28
29
32
class
ValQuantity
:
public
Value
33
{
34
public
:
35
AST_EXPR(
ValQuantity
)
36
37
ValQuantity
(
const
Quantity
& q)
38
:
Value
()
39
, value_(q)
40
{
41
}
42
std::string getExpression(
Object
* context=
nullptr
)
const override
;
43
const
Quantity
& quantity()
const
{
return
value_; }
44
const
Unit
& unit()
const
{
return
value_.unit(); }
45
double
magnitude()
const
{
return
value_.magnitude(); }
46
EDimension
dimension()
const
{
return
value_.
dimension
(); }
47
private
:
48
Quantity
value_;
49
};
50
51
52
AST_NAMESPACE_END
ast::Object
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义
Object.hpp:81
ast::Quantity
数量值
定义
Quantity.hpp:114
ast::Unit
单位
定义
Unit.hpp:136
ast::Unit::dimension
Dimension dimension() const
获取单位量纲
定义
Unit.hpp:437
ast::ValQuantity
数量值
定义
ValQuantity.hpp:33
ast::Value
值对象基类
定义
Value.hpp:36
ast::EDimension
EDimension
量纲枚举类
定义
Dimension.hpp:293
src
AstScript
Value
ValQuantity.hpp
制作者
1.12.0