🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
ValDict.hpp
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "Value.hpp"
25#include "AstUtil/OrderedMap.hpp"
26#include <string>
27#include <map>
28
29AST_NAMESPACE_BEGIN
30
37class AST_SCRIPT_API ValDict: public Value
38{
40public:
41 AST_EXPR(ValDict)
42 static ValDict* New();
43
44 ValDict() = default;
45 ~ValDict() override = default;
46 Value* find(const std::string& name);
47 void insert(const std::string& name, Value* value);
48 using Value::insert;
49 std::string toJsonString() const;
50 std::string toJsonString(int indent) const;
51 std::string getExpression(Object* context=nullptr) const override;
52 const ValueMapType& getMap() const{return map_;}
53protected:
54 std::string toJsonString(int indent, int currentIndent) const;
55protected:
56 MapType map_;
57};
58
61AST_NAMESPACE_END
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义 Object.hpp:86
字典值
定义 ValDict.hpp:38
值对象基类
定义 Value.hpp:43