The program moduleExample.cpp is designed to load this module and check the error return.
ArModule in the reference manual.
00001 #include "Aria.h" 00002 00003 00028 class SimpleMod : public ArModule 00029 { 00030 public: 00031 00032 bool init(ArRobot *robot, void *argument = NULL); 00033 bool exit(); 00034 }; 00035 00036 SimpleMod aModule; 00037 ARDEF_MODULE(aModule); 00038 00039 bool SimpleMod::init(ArRobot *robot, void *argument) 00040 { 00041 ArLog::log(ArLog::Terse, "module: init(%p) called in the loaded module!", robot); 00042 if (argument != NULL) 00043 ArLog::log(ArLog::Terse, "module: Argument given to ArModuleLoader::load was the string '%s'.", 00044 (char *)argument); 00045 else 00046 ArLog::log(ArLog::Terse, "module: No argument was given to ArModuleLoader (this is OK)."); 00047 00048 // Do stuff here... 00049 00050 return(true); 00051 } 00052 00053 bool SimpleMod::exit() 00054 { 00055 ArLog::log(ArLog::Terse, "module: exit() called."); 00056 00057 // Do stuff here... 00058 00059 return(true); 00060 }
1.4.7