Public Member Functions | |
| mxShared (std::string module_name="") | |
| ~mxShared () | |
| bool | loadModule (std::string name) |
| bool | unloadModule () |
| void * | loadFunction (std::string name) |
Protected Attributes | |
| void * | ptr |
Definition at line 31 of file mxfunction.h.
| mx::mxShared::mxShared | ( | std::string | module_name = "" |
) |
default constructor for class
| module_name | module to load, .so, .dll, .dylib |
Definition at line 22 of file mxfunction.cpp.
References loadModule().
00023 { 00024 ptr = 0; 00025 00026 if(module.length()>0) 00027 loadModule(module); 00028 00029 }
| mx::mxShared::~mxShared | ( | ) |
destructor
Definition at line 32 of file mxfunction.cpp.
References unloadModule().
00033 { 00034 00035 unloadModule(); 00036 00037 }
| void * mx::mxShared::loadFunction | ( | std::string | name | ) |
load a function by function name id
| name | function name |
Definition at line 60 of file mxfunction.cpp.
00061 { 00062 00063 if(ptr == 0) return 0; 00064 00065 return SDL_LoadFunction(ptr, name.c_str()); 00066 00067 }
| bool mx::mxShared::loadModule | ( | std::string | name | ) |
load a module by filename
| name | filename of module to load |
Definition at line 39 of file mxfunction.cpp.
Referenced by mxShared().
00040 { 00041 00042 ptr = SDL_LoadObject(module.c_str()); 00043 if(ptr == 0) return false; 00044 00045 return true; 00046 }
| bool mx::mxShared::unloadModule | ( | ) |
unload a module
Definition at line 49 of file mxfunction.cpp.
Referenced by ~mxShared().
00050 { 00051 00052 if(ptr != 0) 00053 SDL_UnloadObject(ptr); 00054 00055 ptr = 0; 00056 00057 return true; 00058 }
1.5.8