60 if (!result.has_value()) {
62 result.error().message());
68 : _handle(other._handle)
70 other._handle =
nullptr;
76 if (this->_handle) [[unlikely]] {
78 if (!result.has_value()) {
80 result.error().message());
83 this->_handle = other._handle;
84 other._handle =
nullptr;
91 -> std::expected<void *, rtp::Error>
Declaration of the DynamicLibrary class.
Declarations for platform-specific dynamic library handling.
Logger declaration with support for multiple log levels.
Represents a dynamically loaded library.
void * _handle
The handle to the dynamic library.
auto getSymbolAddress(std::string_view name) const -> std::expected< void *, rtp::Error >
Get the address of a symbol from the dynamic library.
DynamicLibrary & operator=(DynamicLibrary &&other) noexcept
~DynamicLibrary() noexcept
Destructor.
DynamicLibrary(void *handle) noexcept
Construct a DynamicLibrary with the given handle.
static auto getSymbol(void *handle, std::string_view name) -> std::expected< void *, rtp::Error >
Get a symbol from the dynamic library.
static auto close(void *handle) noexcept -> std::expected< void, rtp::Error >
Close the dynamic library handle.
void warning(LogFmt< std::type_identity_t< Args >... > fmt, Args &&...args) noexcept
Log a warning message.