🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
ValNamedVector.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "Value.hpp"
25#include "AstUtil/OrderedMap.hpp"
26
27AST_NAMESPACE_BEGIN
28
36class AST_SCRIPT_API ValNamedVector: public Value
37{
38public:
39 using ItemType = std::pair<std::string, SharedPtr<Value>>;
40 using VectorType = std::vector<ItemType>;
41 static ValNamedVector* New();
42
43 AST_EXPR(ValNamedVector)
44
45 ValNamedVector() = default;
46 ~ValNamedVector() = default;
49 size_t size() const{return vector_.size();}
50
51
52 VectorType& getVector() {return vector_;}
53 const VectorType& getVector() const {return vector_;}
54
55 std::string getExpression(Object* object) const override;
56private:
57 VectorType vector_;
58};
59
60
63AST_NAMESPACE_END
64
virtual std::string getExpression(Object *context=nullptr) const =0
获取表达式的字符串表示
命名向量值类
定义 ValNamedVector.hpp:37
size_t size() const
获取向量元素数量
定义 ValNamedVector.hpp:49
值对象基类
定义 Value.hpp:43