Air-Trap 1.0.0
A multiplayer R-Type clone game engine built with C++23 and ECS architecture
Loading...
Searching...
No Matches
rtp::sys::impl::LibraryBackend Class Referencefinal

Provides platform-specific implementations for dynamic library operations. More...

#include <LibraryBackend.hpp>

Collaboration diagram for rtp::sys::impl::LibraryBackend:

Static Public Member Functions

static auto open (std::string_view path) -> std::expected< void *, rtp::Error >
 Open a dynamic library from the given path.
 
static auto close (void *handle) noexcept -> std::expected< void, rtp::Error >
 Close the dynamic library handle.
 
static auto getSymbol (void *handle, std::string_view name) -> std::expected< void *, rtp::Error >
 Get a symbol from the dynamic library.
 

Detailed Description

Provides platform-specific implementations for dynamic library operations.

This class encapsulates all platform-dependent code for loading, unloading, and querying symbols from dynamic libraries. It abstracts away the differences between Unix (dlopen) and Windows (LoadLibrary) APIs.

Definition at line 63 of file LibraryBackend.hpp.

Member Function Documentation

◆ close()

auto rtp::sys::impl::LibraryBackend::close ( void *  handle) -> std::expected<void, rtp::Error>
staticnoexcept

Close the dynamic library handle.

Parameters
handleThe handle to close.
Returns
std::expected<void, rtp::Error>

Definition at line 69 of file LibraryBackend_Unix.cpp.

References rtp::Error::failure(), and rtp::LibraryLoadFailed.

Referenced by rtp::sys::DynamicLibrary::~DynamicLibrary(), and rtp::sys::DynamicLibrary::operator=().

◆ getSymbol()

auto rtp::sys::impl::LibraryBackend::getSymbol ( void *  handle,
std::string_view  name 
) -> std::expected<void *, rtp::Error>
static

Get a symbol from the dynamic library.

Parameters
handleThe dynamic library handle.
nameThe name of the symbol to get.
Returns
std::expected<void *, rtp::Error>

Definition at line 84 of file LibraryBackend_Unix.cpp.

References rtp::Error::failure(), RTP_ASSERT, and rtp::SymbolNotFound.

Referenced by rtp::sys::DynamicLibrary::getSymbolAddress().

◆ open()

auto rtp::sys::impl::LibraryBackend::open ( std::string_view  path) -> std::expected<void *, rtp::Error>
static

Open a dynamic library from the given path.

Parameters
pathThe path to the dynamic library.
Returns
std::expected<void *, rtp::Error>

Definition at line 53 of file LibraryBackend_Unix.cpp.

References rtp::Error::failure(), and rtp::LibraryLoadFailed.

Referenced by rtp::sys::LibraryManager::getOrLoadInternal(), and rtp::sys::LibraryManager::loadStandalone().


The documentation for this class was generated from the following files: