UraniumCompute 0.1.0
A GPU accelerated parallel task scheduler
UN::DynamicLibrary Class Reference

A class for loading and unloading DLLs. More...

#include <DynamicLibrary.h>

Inheritance diagram for UN::DynamicLibrary:
UN::Object< IObject > UN::IObject

Public Member Functions

 DynamicLibrary (const DynamicLibrary &)=delete
 
DynamicLibraryoperator= (const DynamicLibrary &)=delete
 
 DynamicLibrary (DynamicLibrary &&)=delete
 
DynamicLibraryoperator= (DynamicLibrary &&)=delete
 
ResultCode Init (std::string_view name)
 Load a library with specified name. More...
 
void Unload ()
 Unload the library.
 
template<class FPtr >
ResultCode GetFunction (const char *functionName, FPtr *pResult)
 Load a function entry point from the DLL. More...
 
- Public Member Functions inherited from UN::Object< IObject >
UInt32 Release () override
 
 Object (const Object &)=delete
 
 Object (Object &&)=delete
 
UInt32 AddRef () override
 Add a strong reference to the object. More...
 
void AttachRefCounter (ReferenceCounter *pRefCounter) override
 Attach a reference counter to the object. More...
 
ReferenceCounterGetRefCounter () override
 Get reference counter attached to this object. More...
 
virtual UInt32 AddRef ()=0
 Add a strong reference to object's reference counter. More...
 
virtual UInt32 Release ()=0
 Remove a strong reference from object's reference counter. More...
 
virtual void AttachRefCounter (ReferenceCounter *counter)=0
 Attach a ReferenceCounter to this object. More...
 
virtual ReferenceCounterGetRefCounter ()=0
 Get reference counter that belongs to this object. More...
 

Static Public Member Functions

static ResultCode Create (DynamicLibrary **ppLibrary)
 

Additional Inherited Members

- Protected Member Functions inherited from UN::Object< IObject >
UInt32 Release (F &&destroyCallback)
 

Detailed Description

A class for loading and unloading DLLs.

Member Function Documentation

◆ GetFunction()

template<class FPtr >
ResultCode UN::DynamicLibrary::GetFunction ( const char *  functionName,
FPtr *  pResult 
)
inline

Load a function entry point from the DLL.

Template Parameters
FPtr- Type of the function pointer to return.
Parameters
functionName- The name of the function to load.
pResult- A pointer to memory where the result will be written.
Returns
ResultCode::Success or an error code.

◆ Init()

ResultCode UN::DynamicLibrary::Init ( std::string_view  name)
inline

Load a library with specified name.

Parameters
name- Dynamic library name.
Returns
ResultCode::Success or an error code.

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