src/engine/plugin_registry.cpp
void *PluginRegistry::loadPlugin(PluginEntry *pluginEntry)
{
  if (nullptr == pluginEntry) {
    return nullptr;
  }

  std::string pluginId = pluginEntry->getId();

  // Check if there is already a handle for this plugin
  if (nullptr != m_pluginHandleMap[pluginId]) {
    return m_pluginHandleMap[pluginId];
  }

  // Open plugin library
  std::cout << "Loading library " << pluginEntry->getLibName() << std::endl;
  void *lib = PluginUtils::OpenPluginLibrary(pluginEntry->getLibName());
  if (!lib) {
    return nullptr;
  }

  // Create and return Operation plugin instance
  void *plugin = PluginUtils::CreatePlugin(lib);

  // Add handles to internal maps for reuse
  m_pluginHandleMap[pluginId] = plugin;
  m_pluginLibMap[pluginId] = lib;

  return plugin;
}
/**
 * Loads the specified plugin.
 *
 * @param pluginEntry Pointer to the corresponding plugin entry
 *
 * @return A pointer to the plugin instance
 */
Loads the specified plugin.
@param pluginEntry Pointer to the corresponding plugin entry

@return A pointer to the plugin instance
Loads the specified plugin . @param pluginEntry Pointer to the corresponding plugin entry @return A pointer to the plugin instance
void *PluginRegistry::loadPlugin(PluginEntry *pluginEntry)
{
  if (nullptr == pluginEntry) {
    return nullptr;
  }
  std::string pluginId = pluginEntry->getId();
  if (nullptr != m_pluginHandleMap[pluginId]) {
    return m_pluginHandleMap[pluginId];
  }
  std::cout << "Loading library " << pluginEntry->getLibName() << std::endl;
  void *lib = PluginUtils::OpenPluginLibrary(pluginEntry->getLibName());
  if (!lib) {
    return nullptr;
  }
  void *plugin = PluginUtils::CreatePlugin(lib);
  m_pluginHandleMap[pluginId] = plugin;
  m_pluginLibMap[pluginId] = lib;
  return plugin;
}
void * PluginRegistry :: loadPlugin ( PluginEntry * pluginEntry ) { if ( nullptr == pluginEntry ) { return nullptr ; } std :: string pluginId = pluginEntry -> getId ( ) ; if ( nullptr != m_pluginHandleMap [ pluginId ] ) { return m_pluginHandleMap [ pluginId ] ; } std :: cout << " " << pluginEntry -> getLibName ( ) << std :: endl ; void * lib = PluginUtils :: OpenPluginLibrary ( pluginEntry -> getLibName ( ) ) ; if ( ! lib ) { return nullptr ; } void * plugin = PluginUtils :: CreatePlugin ( lib ) ; m_pluginHandleMap [ pluginId ] = plugin ; m_pluginLibMap [ pluginId ] = lib ; return plugin ; }
Loads the specified plugin.
Loads the specified plugin .
// Check if there is already a handle for this plugin // Open plugin library // Create and return Operation plugin instance // Add handles to internal maps for reuse