![]() |
ArkScript
A small, fast, functional and scripting language for video games
|
Handling a shared library as an ArkScript plugin. More...
#include <Plugin.hpp>
Public Member Functions | |
SharedLibrary () | |
Construct a new Shared Library object. | |
SharedLibrary (const SharedLibrary &)=delete | |
Disable copy semantics as this contains a pointer. | |
SharedLibrary & | operator= (const SharedLibrary &)=delete |
Disable copy semantics as this contains a pointer. | |
SharedLibrary (std::string path) | |
Construct a new Shared Library object. | |
~SharedLibrary () | |
Destroy the Shared Library object. | |
void | load (const std::string &path) |
Load a shared library. | |
void | unload () const |
Unload the shared library. | |
const std::string & | path () const |
template<typename T > | |
T | get (const std::string &procname) |
Return a function from the shared library. | |
Private Attributes | |
std::string | m_path |
bool | m_loaded |
Handling a shared library as an ArkScript plugin.
Definition at line 39 of file Plugin.hpp.
Ark::internal::SharedLibrary::SharedLibrary | ( | ) |
Construct a new Shared Library object.
Definition at line 8 of file Plugin.cpp.
|
delete |
Disable copy semantics as this contains a pointer.
|
explicit |
Construct a new Shared Library object.
path | path to the shared library |
Definition at line 13 of file Plugin.cpp.
Ark::internal::SharedLibrary::~SharedLibrary | ( | ) |
|
inline |
Return a function from the shared library.
T | the type of the function to retrieve |
procname | the name of the function to retrieve |
Definition at line 96 of file Plugin.hpp.
void Ark::internal::SharedLibrary::load | ( | const std::string & | path | ) |
Load a shared library.
path | path to the shared library |
Definition at line 26 of file Plugin.cpp.
References m_loaded, m_path, path(), and unload().
Referenced by SharedLibrary().
|
delete |
Disable copy semantics as this contains a pointer.
|
inlinenodiscard |
void Ark::internal::SharedLibrary::unload | ( | ) | const |
Unload the shared library.
Definition at line 49 of file Plugin.cpp.
References m_loaded.
Referenced by load(), and ~SharedLibrary().
|
private |
Definition at line 123 of file Plugin.hpp.
|
private |
Definition at line 122 of file Plugin.hpp.
Referenced by load(), path(), and SharedLibrary().