🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
TraitPosVel.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "TraitObject.hpp"
25
26AST_NAMESPACE_BEGIN
27
28class Type;
29
30
33{
34public:
35 virtual ~IPosVelPrv()
36 {};
37 virtual Type* type() const = 0;
38 virtual errc_t getPosIn(System* system, const AbsTime& time, Vector3d& pos) const = 0;
39 virtual errc_t getPosVelIn(System* system, const AbsTime& time, Vector3d& pos, Vector3d& vel) const = 0;
40};
41
42
43
44template<typename T>
45class ImplFor<IPosVelPrv, T>: public TraitObject<IPosVelPrv>
46{
47public:
49 ImplFor(T* obj)
50 :Base{ obj }
51 {}
52 ImplFor(const T& obj)
53 :Base{(void*) & obj}
54 {}
55 Type* type() const override
56 {
57 return T::staticType();
58 }
59 errc_t getValue(const AbsTime& time, double& value) const override
60 {
61 return get()->getValue(time, value);
62 }
63
64 T* get() const{return (T*) data_; }
65};
66
67
68
69
70AST_NAMESPACE_END
71
类元信息
定义 Class.hpp:37
提供位置速度
定义 TraitPosVel.hpp:33
定义 TraitObject.hpp:39
定义 TraitObject.hpp:30