#include <ArModuleLoader.h>
Public Types | |
typedef void * | DllRef |
enum | Status { STATUS_SUCCESS = 0, STATUS_ALREADY_LOADED, STATUS_FAILED_OPEN, STATUS_INVALID, STATUS_INIT_FAILED, STATUS_EXIT_FAILED, STATUS_NOT_FOUND } |
Static Public Member Functions | |
static Status | close (const char *modName, bool quiet=false) |
Close an ArModule. | |
static void | closeAll () |
Close all open ArModule. | |
static Status | load (const char *modName, ArRobot *robot, void *modArgument=NULL, bool quiet=false) |
Load an ArModule. | |
static Status | reload (const char *modName, ArRobot *robot, void *modArgument=NULL, bool quiet=false) |
Close and then reload an ArModule. | |
Static Protected Attributes | |
static std::map< std::string, DllRef > | ourModMap |
The ArModuleLoader is used to load ArModules into a program and invoke them.
See also ArModule to see how to define an ArModule.
See also the example programs simpleMod.cpp and simpleModule.cpp. For a more complete example, see the example programs joydriveActionMod.cpp and joydriveActionModule.cpp.
Definition at line 48 of file ArModuleLoader.h.
|
Definition at line 58 of file ArModuleLoader.h. |
|
Close an ArModule. Calls ArModule::exit() on the module, then closes the library.
Definition at line 184 of file ArModuleLoader.cpp. References ArLog::log(), STATUS_INIT_FAILED, STATUS_NOT_FOUND, and STATUS_SUCCESS. Referenced by closeAll(), and reload(). |
|
Load an ArModule. THIS ONLY LOADS one init on the module right now, if its called again it'll load the same init over. I'll fix it later... read the more verbose description in ArModule.h. Takes a string name of the module which is just the file name of the module without the extension (.dll or .so). It will figure out the correct extension based on wheter its a Linux or Windows build. It will also uses the standard operating systems ability to find the library. So the library must be located within the PATH variable for Windows and the LD_LIBRARY_PATH for Linux. You can also just give the absolute path to the library, or the relative path from the directory the program was started in (ie ./simpleMod). The ArModule will be passed the ArRobot reference that load() takes. This is the ArRobot that the ArModule will use for its processing.
Definition at line 100 of file ArModuleLoader.cpp. References ArLog::log(), STATUS_ALREADY_LOADED, STATUS_FAILED_OPEN, STATUS_INIT_FAILED, and STATUS_SUCCESS. Referenced by reload(). |
|
Close and then reload an ArModule. reload() is similiar to load(), except that it will call close() on the module and then call load().
Definition at line 169 of file ArModuleLoader.cpp. |