|
Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
|
Represents a dynamically loaded library. More...
#include <DynamicLibrary.hpp>
Public Member Functions | |
| DynamicLibrary (void *handle) noexcept | |
| Construct a DynamicLibrary with the given handle. | |
| ~DynamicLibrary () noexcept | |
| Destructor. | |
| DynamicLibrary (DynamicLibrary &&other) noexcept | |
| DynamicLibrary & | operator= (DynamicLibrary &&other) noexcept |
| DynamicLibrary (const DynamicLibrary &)=delete | |
| DynamicLibrary & | operator= (const DynamicLibrary &)=delete |
| template<typename T > | |
| auto | get (std::string_view name) const -> std::expected< T, rtp::Error > |
| Get a symbol from the dynamic library. | |
Private Member Functions | |
| auto | getSymbolAddress (std::string_view name) const -> std::expected< void *, rtp::Error > |
| Get the address of a symbol from the dynamic library. | |
Private Attributes | |
| void * | _handle {nullptr} |
| The handle to the dynamic library. | |
Represents a dynamically loaded library.
Provides methods to retrieve symbols from the library.
Definition at line 56 of file DynamicLibrary.hpp.
|
explicitnoexcept |
Construct a DynamicLibrary with the given handle.
| handle | The handle to the dynamic library. |
Definition at line 52 of file DynamicLibrary.cpp.
|
noexcept |
Destructor.
Closes the dynamic library.
Definition at line 56 of file DynamicLibrary.cpp.
References _handle, rtp::sys::impl::LibraryBackend::close(), and rtp::log::warning().
|
noexcept |
Definition at line 67 of file DynamicLibrary.cpp.
|
delete |
| auto rtp::sys::DynamicLibrary::get | ( | std::string_view | name | ) | const -> std::expected< T, rtp::Error > |
Get a symbol from the dynamic library.
| T | The expected type of the symbol. |
| name | The name of the symbol to retrieve. |
Referenced by rtp::sys::LibraryManager::load().
|
private |
Get the address of a symbol from the dynamic library.
| name | The name of the symbol to retrieve. |
Definition at line 90 of file DynamicLibrary.cpp.
References rtp::sys::impl::LibraryBackend::getSymbol().
|
delete |
|
noexcept |
Definition at line 73 of file DynamicLibrary.cpp.
References rtp::sys::impl::LibraryBackend::close(), and rtp::log::warning().
|
private |
The handle to the dynamic library.
Definition at line 89 of file DynamicLibrary.hpp.
Referenced by ~DynamicLibrary().