|
🛰️航天仿真算法库 SpaceAST 0.4.0
|
#include <Library.hpp>
Public 成员函数 | |
| Library ()=default | |
| Library (StringView fileName) | |
| ~Library () | |
| errc_t | load (StringView fileName) |
| errc_t | unload () |
| bool | isLoaded () const |
| void * | resolve (const char *symbol) const |
| std::string | filePath () const |
静态 Public 成员函数 | |
| static bool | IsLibrary (StringView fileName) |
| static void * | Resolve (StringView fileName, const char *symbol) |
动态库加载类
封装动态库的加载、符号解析和卸载,提供 RAII 生命周期管理。
使用示例:
| errc_t ast::Library::load | ( | StringView | fileName | ) |
加载动态库,然后卸载旧库
|
static |
加载库并解析符号
库加载后保持到进程退出
| fileName | 库文件名 |
| symbol | 符号名称 |
| void * ast::Library::resolve | ( | const char * | symbol | ) | const |
解析符号地址
| symbol | 符号名称 |
| errc_t ast::Library::unload | ( | ) |
卸载动态库