🛰️航天仿真算法库 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
63 std::string getExpression(Object* context=nullptr) const override;
64
65
69 const Attribute& attribute() const{return attribute_;}
70
74 void setAttribute(const Attribute& attribute){attribute_ = attribute;}
75private:
76 Attribute attribute_;
77};
78
79
82AST_NAMESPACE_END
属性表达式
定义 ExprAttribute.hpp:36
void setAttribute(const Attribute &attribute)
定义 ExprAttribute.hpp:74
const Attribute & attribute() const
定义 ExprAttribute.hpp:69
表达式基类
定义 Expr.hpp:39
virtual errc_t setValue(Value *val)
设置表达式的值
定义 Expr.hpp:60
virtual Value * eval() const =0
求值
virtual std::string getExpression(Object *context=nullptr) const =0
获取表达式的字符串表示
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义 Object.hpp:86
值对象基类
定义 Value.hpp:43