🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
MockObject.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstUtil/Object.hpp"
25
26AST_NAMESPACE_BEGIN
27
33class AST_MOCK_API MockObject: public Object
34{
35public:
36 AST_OBJECT(MockObject)
37 AST_PROPERT(x)
38 AST_PROPERT(duration)
39 AST_PROPERT(factor)
40 MockObject() = default;
41 ~MockObject() = default;
42PROPERTIES:
43 length_d x() const { return x_; }
44 void setX(length_d x) { x_ = x; }
45 time_d duration() const { return duration_; }
46 void setDuration(time_d duration) { duration_ = duration; }
47 double factor() const { return factor_; }
48 void setFactor(double factor) { factor_ = factor; }
49private:
50 length_d x_{0.0};
51 time_d duration_{0.0};
52 double factor_{1.0};
53};
54
57AST_NAMESPACE_END
定义 MockObject.hpp:34
对象基类,继承自该类的对象可以使用运行时类型信息相关功能,实现强弱引用计数、运行时元信息(属性访问、序列化等)等基础功能
定义 Object.hpp:86