🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
ExprAttribute.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "Expr.hpp"
25
26AST_NAMESPACE_BEGIN
27
35class AST_SCRIPT_API ExprAttribute : public Expr
36{
37public:
38 AST_EXPR(ExprAttribute)
39
40
43 static ExprAttribute* New(const Attribute& attribute);
44
48 ExprAttribute(const Attribute& attribute);
49
53 Value* eval() const override;
54
58 errc_t setValue(Value* value) override;
59
60 errc_t setValueDouble(double val) override;
61
62 errc_t getValueDouble(double& val) const override;
63
67 std::string getExpression(Object* context=nullptr) const override;
68
69
73 const Attribute& attribute() const{return attribute_;}
74
78 void setAttribute(const Attribute& attribute){attribute_ = attribute;}
79private:
80 Attribute attribute_;
81};
82
83
86AST_NAMESPACE_END
属性表达式
定义 ExprAttribute.hpp:36
void setAttribute(const Attribute &attribute)
定义 ExprAttribute.hpp:78
const Attribute & attribute() const
定义 ExprAttribute.hpp:73
表达式基类
定义 Expr.hpp:40
virtual errc_t setValueDouble(double val)
设置表达式的双精度值
定义 Expr.cpp:32
virtual errc_t getValueDouble(double &val) const
获取表达式的双精度值
定义 Expr.cpp:38
virtual errc_t setValue(Value *val)
设置表达式的值
定义 Expr.hpp:56
virtual Value * eval() const =0
求值
virtual std::string getExpression(Object *context=nullptr) const =0
获取表达式的字符串表示
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义 Object.hpp:95
值对象基类
定义 Value.hpp:43