🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
Struct.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "Field.hpp"
25#include <unordered_map>
26#include <vector>
27
28
29AST_NAMESPACE_BEGIN
30
31class Property;
32
36class AST_UTIL_API Struct: public Field
37{
38public:
39 using Field::Field;
40
41 ~Struct() override;
42
43 // @todo: 考虑使用StringView作为索引
44 using PropertyMap = std::unordered_map<std::string, Property*>;
45 using PropertyList = std::vector<Property*>;
46
47 Property* addProperty(StringView name, Property* property);
48
52 Property* addProperty(Property* property);
53
57 Property* getProperty(StringView name);
58
61 const PropertyList& getProperties() const{return properties_;}
62
65 std::string getModuleName() const;
66
67protected:
68 PropertyList properties_;
69 PropertyMap propertyMap_;
70};
71
72
73
74AST_NAMESPACE_END
反射字段类
定义 Field.hpp:34
反射属性类
定义 Property.hpp:58
结构体类
定义 Struct.hpp:37
const PropertyList & getProperties() const
获取属性列表
定义 Struct.hpp:61