VenomEngine
Cross-Platform Modern Graphics Engine
Loading...
Searching...
No Matches
venom::common::DLL Class Reference

Contains a shared library handle and provides a way to get symbols from it, can only be created through DLL::Create() More...

#include <DLL.h>

Public Member Functions

void * GetFunction (const char *name)
 Gets a function from the DLL.
 
Error LoadDLL (const char *path)
 
Error ReloadDLL (const char *path)
 
void UnloadDLL () const
 

Static Public Member Functions

static DLLCreate ()
 Forces user to use dynamic allocation.
 
static DLLGetFromCache (const std::string &path)
 Searched for DLL in cache, if not found creates a new one.
 

Public Attributes

template<typename ReturnType , typename... Args>
ReturnType(*)(Args...) GetFunction (const char *name)
 Gets a function from the DLL and casts it to the correct type.
 

Detailed Description

Contains a shared library handle and provides a way to get symbols from it, can only be created through DLL::Create()

Member Function Documentation

◆ Create()

DLL * venom::common::DLL::Create ( )
static

Forces user to use dynamic allocation.

Returns
new DLL

◆ GetFromCache()

DLL * venom::common::DLL::GetFromCache ( const std::string & path)
static

Searched for DLL in cache, if not found creates a new one.

Returns
existing or new DLL

◆ GetFunction()

void * venom::common::DLL::GetFunction ( const char * name)

Gets a function from the DLL.

Parameters
namefunction name
Returns
sym address

Member Data Documentation

◆ GetFunction

template<typename ReturnType , typename... Args>
ReturnType(*)(Args...) venom::common::DLL::GetFunction(const char *name)
inline

Gets a function from the DLL and casts it to the correct type.

Template Parameters
ReturnTypereturn type of the function
Argstypes of each args
Parameters
namefunction name
Returns
sym address in the form ReturnType(*)(Args...)

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