Skip to content

File include/brisk/core/DynamicLibrary.hpp


DynamicLibrary class

DynamicLibrary

DynamicLibraryProvides an interface to dynamically load and access functions from shared libraries.

func function (DynamicLibrary::func)

template <typename Func>
Func *func(const std::string &name) const noexcept
  requires std::is_function_v<Func>

Retrieves a pointer to a function from the dynamic library.
Template param Func The function type to retrieve.
Param name The name of the function in the library.
Returns A pointer to the function if found; otherwise, nullptr.

load function (DynamicLibrary::load)

static RC<DynamicLibrary>
load(const std::string &name) noexcept

Loads a dynamic library by its name.
Param name The name of the library to load.
Returns A smart pointer to the loaded dynamic library.

~DynamicLibrary function (DynamicLibrary::~DynamicLibrary)

~DynamicLibrary()

Destructor for the DynamicLibrary class.
Details Cleans up and closes the dynamic library.


DynamicFunc class

template <typename Func> DynamicFunc

DynamicFuncA wrapper for a function from a dynamically loaded library.
Template param Func The type of the function being wrapped.

DynamicFunc<Func> function (DynamicFunc::DynamicFunc<Func>)

DynamicFunc(const RC<DynamicLibrary> &library,
            const std::string &name)

Constructs a DynamicFunc object.
Param library A smart pointer to the dynamic library.
Param name The name of the function in the library.

DynamicFunc(const RC<DynamicLibrary> &library,
            const std::string &name, bool &flag)
    : DynamicFunc(library, name)

Constructs a DynamicFunc object and sets a flag if the function is not found.
Param library A smart pointer to the dynamic library.
Param name The name of the function in the library.
Param flag A boolean flag that is set to false if the function is not found.

operator() function (DynamicFunc::operator())

template <typename... Args>
decltype(auto) operator()(Args &&...args) const noexcept

Calls the wrapped function with the provided arguments.
Template param Args Types of the arguments to be passed to the function.
Param args The arguments to pass to the function.
Returns The result of the function call.
Note This method is noexcept.


Auto-generated from sources, Revision , https://github.com/brisklib/brisk/blob//include/brisk/