🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
ast::SpiceApi类 参考

#include <SpiceApi.hpp>

Public 类型

enum  {
  ifurnsh = 0 , ispkgeo , ispklef , ispkuef ,
  iktotal , ibodc2n , ierract , ifailed ,
  ireset , numfunctions
}
 
using funcarray = std::array<void*, numfunctions>
 

Public 成员函数

 SpiceApi ()=default
 
 SpiceApi (bool shouldLoadDynamicLib)
 
errc_t load (StringView libpath)
 
errc_t tryload (const std::vector< std::string > &libpaths)
 
errc_t unload ()
 
bool isLoaded () const
 
errc_t furnsh (const char *libpath)
 
errc_t spkgeo (int targ, double et, const char *ref, int obs, double state[6], double *lt)
 
errc_t spklef (const char *libpath, int *handle)
 
errc_t spkuef (int handle)
 
errc_t ktotal (const char *kind, int *count)
 
int ktotal (const char *kind)
 
void bodc2n (int code, int namlen, char *name, bool *found)
 
errc_t bodc2n (int code, std::string &name)
 
bool failed ()
 
void reset ()
 
void erract (const char *operation, int lenout, char *action)
 

静态 Public 成员函数

static SpiceApiInstance ()
 

Protected 成员函数

errc_t checkerror ()
 
 A_DISABLE_COPY (SpiceApi)
 

Protected 属性

void * library_ {nullptr}
 
std::vector< uint32_t > spk_handles_
 
funcarray functions_ {}
 
std::mutex mutex_
 

详细描述

Spice API

处理CSPICE库的动态加载、卸载、函数调用等

警告
注意CSPICE库的默认长度单位是**千米** 这里不会对CSPICE库进行额外的包装,只会进行一次调用的转发

构造及析构函数说明

◆ SpiceApi()

ast::SpiceApi::SpiceApi ( bool shouldLoadDynamicLib)
参数
shouldLoadDynamicLib是否自动加载动态库

成员函数说明

◆ erract()

void ast::SpiceApi::erract ( const char * operation,
int lenout,
char * action )

错误处理函数

参数
action错误处理操作

◆ failed()

bool ast::SpiceApi::failed ( )

检查是否发生错误

返回
是否发生错误

◆ furnsh()

errc_t ast::SpiceApi::furnsh ( const char * libpath)

加载spice内核文件

参数
libpath内核文件路径
返回
错误码

◆ Instance()

SpiceApi * ast::SpiceApi::Instance ( )
static

获取单例实例

返回
单例实例指针

◆ isLoaded()

bool ast::SpiceApi::isLoaded ( ) const
inline

检查是否加载了库

返回
是否加载了库

◆ ktotal()

errc_t ast::SpiceApi::ktotal ( const char * kind,
int * count )

获取已加载的内核数量

参数
kind内核类型
count内核数量
返回
错误码

◆ load()

errc_t ast::SpiceApi::load ( StringView libpath)
参数
libpath库路径
返回
错误码

◆ spkgeo()

errc_t ast::SpiceApi::spkgeo ( int targ,
double et,
const char * ref,
int obs,
double state[6],
double * lt )

计算spice位置

参数
targ目标体ID
et时间,相对于J2000.0 TDB的秒数,并以TDB为时间递进尺度
ref参考系
obs观察者ID
state状态向量
lt光行时
返回
错误码

◆ spklef()

errc_t ast::SpiceApi::spklef ( const char * libpath,
int * handle )

加载SPK内核文件

在CSPICE的接口基础上增加了引用计数机制

参数
libpath内核文件路径
handle内核句柄
返回
错误码

◆ spkuef()

errc_t ast::SpiceApi::spkuef ( int handle)

鞋子SPK内核文件

在CSPICE的接口基础上增加了引用计数机制

参数
handle内核句柄
返回
错误码

◆ tryload()

errc_t ast::SpiceApi::tryload ( const std::vector< std::string > & libpaths)

尝试加载库

尝试加载库,指定多个可能的库路径,直到成功加载为止。

参数
libpaths库路径列表
返回
错误码

◆ unload()

errc_t ast::SpiceApi::unload ( )

卸载库

返回
错误码

该类的文档由以下文件生成: