🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
TraitPosVel.hpp
浏览该文件的文档.
1
20
21
#pragma once
22
23
#include "AstGlobal.h"
24
#include "
TraitObject.hpp
"
25
26
AST_NAMESPACE_BEGIN
27
28
class
Type;
29
30
32
class
IPosVelPrv
33
{
34
public
:
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
44
template
<
typename
T>
45
class
ImplFor
<
IPosVelPrv
, T>:
public
TraitObject
<IPosVelPrv>
46
{
47
public
:
48
typedef
TraitObject<IPosVelPrv>
Base
;
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
70
AST_NAMESPACE_END
71
TraitObject.hpp
ast::Class
类元信息
定义
Class.hpp:37
ast::IPosVelPrv
提供位置速度
定义
TraitPosVel.hpp:33
ast::ImplFor
定义
TraitObject.hpp:39
ast::TraitObject
定义
TraitObject.hpp:30
src
AstCore
Trait
TraitPosVel.hpp
制作者
1.12.0