|
MXVM 1.8.1
Virtual Machine, Compiler, and Pascal Frontend
|
Wraps a dynamically loaded native function from a shared library module. More...
#include <icode.hpp>
Public Member Functions | |
| RuntimeFunction () | |
| Default constructor — null function pointer and handle. | |
| RuntimeFunction (const RuntimeFunction &r) | |
| Copy constructor. | |
| RuntimeFunction & | operator= (const RuntimeFunction &r) |
| Copy-assignment operator. | |
| ~RuntimeFunction ()=default | |
| RuntimeFunction (const std::string &mod, const std::string &name) | |
| Load a function symbol from a shared library. | |
| void | call (Program *program, std::vector< Operand > &operands) |
| Invoke the loaded function. | |
Public Attributes | |
| void * | func = nullptr |
| resolved function pointer | |
| void * | handle = nullptr |
| dlopen handle | |
| std::string | mod_name |
| module name | |
| std::string | fname |
| function symbol name | |
Static Public Attributes | |
| static std::unordered_map< std::string, void * > | handles |
| cached library handles | |
Wraps a dynamically loaded native function from a shared library module.
Manages dlopen handles and function pointers for external module calls. Shared library handles are cached in a static map.
|
inline |
Default constructor — null function pointer and handle.
Definition at line 81 of file icode.hpp.
Referenced by RuntimeFunction(), and operator=().
|
inline |
|
default |
| mxvm::RuntimeFunction::RuntimeFunction | ( | const std::string & | mod, |
| const std::string & | name ) |
|
inline |
| std::string mxvm::RuntimeFunction::fname |
function symbol name
Definition at line 110 of file icode.hpp.
Referenced by RuntimeFunction(), RuntimeFunction(), call(), and operator=().
| void* mxvm::RuntimeFunction::func = nullptr |
resolved function pointer
Definition at line 107 of file icode.hpp.
Referenced by RuntimeFunction(), RuntimeFunction(), RuntimeFunction(), call(), and operator=().
| void* mxvm::RuntimeFunction::handle = nullptr |
dlopen handle
Definition at line 108 of file icode.hpp.
Referenced by RuntimeFunction(), RuntimeFunction(), RuntimeFunction(), call(), and operator=().
|
static |
cached library handles
Definition at line 111 of file icode.hpp.
Referenced by RuntimeFunction(), and mxvm::Program::~Program().
| std::string mxvm::RuntimeFunction::mod_name |
module name
Definition at line 109 of file icode.hpp.
Referenced by RuntimeFunction(), call(), and operator=().