74 lazyResolution_(lazyResolution), localResolution_(local) {
97 string method =
"PluginTools::addSearchPath()";
98 string message =
"Path doesn't exist";
139 if (module.empty()) {
140 string method =
"PluginTools::registerModule()";
141 string message =
"Empty module file name.";
142 throw FileNotFound(__FILE__, __LINE__, method, message);
147 string path = module;
150 bool moduleFound =
false;
153 for (
unsigned int i = 0; i <
searchPaths_.size(); i++) {
162 string method =
"PluginTools::registerModule()";
163 string message =
"Module not found";
164 throw FileNotFound(__FILE__, __LINE__, method, message);
183 flags |= RTLD_GLOBAL;
186 handle = dlopen(path.c_str(), flags);
188 if (handle == NULL) {
189 string method =
"PluginTools::registerModule()";
190 string message = dlerror();
208 string method =
"PluginTools::unregisterModule()";
209 string path = module;
216 string msg =
"Module not found";
220 void* handle = (*mt).second;
222 if (dlclose(handle) != 0) {
223 string message = dlerror();
239 void* handle = (*mt).second;
240 std::string moduleName = (*mt).first;
272 string path = module;
290 void* handle = (*mt).second;
291 const char* error = NULL;
296 void* sym = dlsym(handle, symbolName.c_str());
297 if ((error = dlerror()) != NULL) {
303 string message =
"Symbol not found: ";
304 message += symbolName;
308 __FILE__, __LINE__,
__func__, error);
319 void* handle = (*mt).second;
320 const char* error = NULL;
322 void* sym = dlsym(handle, symbolName.c_str());
323 if ((error = dlerror()) == NULL) {
329 string method =
"PluginTools::loadSym()";
330 string message =
"Symbol not found";
348 bool moduleFound =
false;
351 const string fullPath = (*mt).first;
353 if (module == fullPath ||
354 module == fileName ||
358 string method =
"PluginTools::findModule()";
359 string message =
"Multiple modules found";
361 __FILE__, __LINE__, method, message);
370 string method =
"PluginTools::findModule()";
371 string message =
"Module not found";
372 throw FileNotFound(__FILE__, __LINE__, method, message);