🛰️航天仿真算法库 SpaceAST 0.4.0
载入中...
搜索中...
未找到
Library.hpp
浏览该文件的文档.
1
20
21#pragma once
22
23#include "AstGlobal.h"
24#include "AstUtil/StringView.hpp"
25
26AST_NAMESPACE_BEGIN
27
47class AST_UTIL_API Library
48{
49public:
51 Library() = default;
52
54 explicit Library(StringView fileName);
55
57 ~Library();
58
59 A_DISABLE_COPY(Library)
60
61
63 errc_t load(StringView fileName);
64
67 errc_t unload();
68
70 bool isLoaded() const { return handle_ != nullptr; }
71
76 void* resolve(const char* symbol) const;
77
79 std::string filePath() const;
80
82 static bool IsLibrary(StringView fileName);
83
89 static void* Resolve(StringView fileName, const char* symbol);
90
91private:
92 void* handle_{ nullptr };
93};
94
97AST_NAMESPACE_END
动态库加载类
定义 Library.hpp:48
Library()=default
默认构造函数(不加载任何库)
bool isLoaded() const
判断动态库是否已加载
定义 Library.hpp:70