#include <DynamicModuleHandle.h>
Public Member Functions | |
virtual | ~DynamicModuleHandle ()=default |
Platform-specific implementation should call Unload(). | |
DynamicModuleHandle (const DynamicModuleHandle &)=delete | |
DynamicModuleHandle & | operator= (const DynamicModuleHandle &)=delete |
bool | Load (bool isInitializeFunctionRequired) |
bool | Unload () |
virtual bool | IsLoaded () const =0 |
const char * | GetFilename () const |
template<typename Function > | |
Function | GetFunction (const char *functionName) const |
Static Public Member Functions | |
static AZStd::unique_ptr< DynamicModuleHandle > | Create (const char *fullFileName) |
Protected Types | |
enum class | LoadStatus { LoadSuccess , LoadFailure , AlreadyLoaded } |
Protected Attributes | |
AZ::IO::FixedMaxPathString | m_fileName |
Store the module name for future loads. | |
AZ::EnvironmentVariable< bool > | m_initialized |
Handles platform-specific interaction with dynamic modules (aka DLLs, aka dynamic link libraries, aka shared libraries).
|
static |
Creates a platform-specific DynamicModuleHandle. Note that the specified module is not loaded until Load is called.
|
inline |
|
inline |
Returns a function from the module. nullptr is returned if the function is inaccessible or the module is not loaded.
|
pure virtual |
bool AZ::DynamicModuleHandle::Load | ( | bool | isInitializeFunctionRequired | ) |
Loads the module. Invokes the InitializeDynamicModuleFunction if it is found in the module and this is the first time loading the module.
isInitializeFunctionRequired | Whether a missing InitializeDynamicModuleFunction causes the Load to fail. |
bool AZ::DynamicModuleHandle::Unload | ( | ) |
Unload the module. Invokes the UninitializeDynamicModuleFunction if it is found in the module and this was the first handle to load the module.