MCPcopy Create free account
hub / github.com/PDAL/PDAL / loadByPath

Method loadByPath

pdal/PluginManager.cpp:316–346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314*/
315template <typename T>
316bool PluginManager<T>::loadByPath(const std::string& path)
317{
318 if (libraryLoaded(path))
319 return true;
320
321 m_log->get(LogLevel::Debug) << "Attempting to load plugin '" <<
322 path << "'." << std::endl;
323 DynamicLibrary *d = loadLibrary(path);
324 if (!d)
325 return false;
326
327 m_log->get(LogLevel::Debug) << "Loaded plugin '" << path <<
328 "'." << std::endl;
329 PF_InitFunc initFunc;
330
331 // This awfulness is to work around a warning that some compilers
332 // generate when casting a void * to a function *. See the example
333 // in the dlsym manpage.
334 *(void **)(&initFunc) = d->getSymbol("PF_initPlugin");
335 if (!initFunc)
336 {
337 m_log->get(LogLevel::Debug) << "No symbol 'PF_initPlugin' found "
338 "in plugin '" << path << "'." << std::endl;
339 return false;
340 }
341 initFunc();
342 m_log->get(LogLevel::Debug) << "Initialized plugin '" <<
343 path << "'." << std::endl;
344
345 return true;
346}
347
348
349template <typename T>

Callers

nothing calls this directly

Calls 2

getSymbolMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected