35 T getPendingSymbol(
const char *name)
const {
36 if (!m_pendingLibrary.isLoaded()) {
40 return m_pendingLibrary.getSymbol<T>(name);
43 MODULE_UPDATE_RESULT update();
48 T getSymbol(
const char *name)
const {
49 if (!m_library.isLoaded()) {
53 return m_library.getSymbol<T>(name);
56 [[nodiscard]]
bool isLoaded()
const {
57 return m_library.isLoaded();
60 [[nodiscard]]
const std::filesystem::path &getModulePath()
const {
65 struct RetiredGeneration {
67 std::filesystem::path shadowPath;
70 bool loadGeneration(std::filesystem::file_time_type writeTime);
72 void beginPendingReload(std::filesystem::file_time_type writeTime);
74 void clearPendingReload();
76 std::uint64_t getProcessId();
78 [[nodiscard]] std::filesystem::path createShadowPath();
81 std::filesystem::path m_modulePath;
82 std::filesystem::path m_shadowPath;
85 std::filesystem::path m_pendingShadowPath;
86 std::filesystem::file_time_type m_pendingLibraryWriteTime{};
88 std::filesystem::file_time_type m_lastWriteTime{};
89 std::uint32_t m_generation = 0;
91 std::optional<std::filesystem::file_time_type> m_pendingWriteTime;
93 std::chrono::steady_clock::time_point m_nextPrepareAttempt{};
95 bool m_prepareFailureLogged =
false;
96 bool m_inspectionFailureLogged =
false;
98 std::vector<RetiredGeneration> m_retiredGenerations;