🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
OpBin.hpp
浏览该文件的文档.
1
20
21
#pragma once
22
23
#include "AstGlobal.h"
24
#include "
Op.hpp
"
25
#include "AstScript/ScriptAPI.hpp"
26
#include <mutex>
27
#include <atomic>
28
29
AST_NAMESPACE_BEGIN
30
33
class
OpBin
:
public
Op
34
{
35
public
:
36
AST_EXPR(
OpBin
)
37
38
public
:
39
OpBin
(
EOpBinType
op,
Expr
* left,
Expr
* right)
40
: op_(op), left_(left), right_(right)
41
{};
42
virtual
~OpBin
() =
default
;
43
Value
* eval()
const override
;
44
std::string getExpression(
Object
* context=
nullptr
)
const override
;
45
protected
:
46
EOpBinType
op_
;
47
SharedPtr<Expr>
left_
;
48
SharedPtr<Expr>
right_
;
49
50
mutable
std::atomic<OpBinFunc> func_{
nullptr
};
51
mutable
std::atomic<Class*> leftType_{
nullptr
};
52
mutable
std::atomic<Class*> rightType_{
nullptr
};
53
mutable
std::mutex
cache_mutex_
;
54
};
55
56
57
58
AST_NAMESPACE_END
Op.hpp
~
ast::Expr
表达式基类
定义
Expr.hpp:39
ast::Object
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义
Object.hpp:81
ast::OpBin
二元运算符表达式
定义
OpBin.hpp:34
ast::OpBin::op_
EOpBinType op_
运算符
定义
OpBin.hpp:46
ast::OpBin::left_
SharedPtr< Expr > left_
左操作数
定义
OpBin.hpp:47
ast::OpBin::cache_mutex_
std::mutex cache_mutex_
用于保护缓存成员的互斥锁
定义
OpBin.hpp:53
ast::OpBin::right_
SharedPtr< Expr > right_
右操作数
定义
OpBin.hpp:48
ast::Op
运算符表达式
定义
Op.hpp:32
ast::SharedPtr
共享指针
定义
SharedPtr.hpp:33
ast::Value
值对象基类
定义
Value.hpp:36
ast::EOpBinType
EOpBinType
定义
ScriptAPI.hpp:40
src
AstScript
Operator
OpBin.hpp
制作者
1.12.0