本文整理汇总了C++中DynLib::getSymbol方法的典型用法代码示例。如果您正苦于以下问题:C++ DynLib::getSymbol方法的具体用法?C++ DynLib::getSymbol怎么用?C++ DynLib::getSymbol使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DynLib
的用法示例。
在下文中一共展示了DynLib::getSymbol方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadPlugin
bool PluginManager::loadPlugin(const std::string& _file)
{
#ifdef EMSCRIPTEN
return false;
#endif
MYGUI_ASSERT(mIsInitialise, getClassTypeName() << " used but not initialised");
// Load plugin library
DynLib* lib = DynLibManager::getInstance().load(_file);
if (!lib)
{
MYGUI_LOG(Error, "Plugin '" << _file << "' not found");
return false;
}
// Call startup function
DLL_START_PLUGIN pFunc = reinterpret_cast<DLL_START_PLUGIN>(lib->getSymbol("dllStartPlugin"));
if (!pFunc)
{
MYGUI_LOG(Error, "Cannot find symbol 'dllStartPlugin' in library " << _file);
return false;
}
// Store for later unload
mLibs[_file] = lib;
// This must call installPlugin
pFunc();
return true;
}
示例2: start_func
Plugin *
PluginManager::load(std::string const & path)
{
if (!initialized)
{
std::cerr << "PluginManager: Manager not initialized" << std::endl;
return NULL;
}
if (dynlibs.find(path) != dynlibs.end()) return NULL;
DynLib * dynlib = DynLibManager::load(path);
dynlibs[path] = dynlib;
SNL_DLL_START_PLUGIN start_func = (SNL_DLL_START_PLUGIN)dynlib->getSymbol("dllStartPlugin");
return start_func(); // this must call install(), which adds the plugin to the installed list
}
示例3: loadPlugin
//-----------------------------------------------------------------------
void Root::loadPlugin(const String& pluginName)
{
// Load plugin library
DynLib* lib = DynLibManager::getSingleton().load( pluginName );
// Store for later unload
mPluginLibs.push_back(lib);
// Call startup function
DLL_START_PLUGIN pFunc = (DLL_START_PLUGIN)lib->getSymbol("dllStartPlugin");
if (!pFunc)
OGRE_EXCEPT(Exception::ERR_ITEM_NOT_FOUND, "Cannot find symbol dllStartPlugin in library " + pluginName,
"Root::loadPlugin");
// This must call installPlugin
pFunc();
}
示例4: loadPlugin
//-------------------------------------------------------------------------------//
void Root::loadPlugin(const String& pluginName)
{
DynLib* lib = TITAN_NEW DynLib(pluginName);
lib->load();
if (std::find(mDynLibVector.begin(), mDynLibVector.end(), lib) == mDynLibVector.end())
{
mDynLibVector.push_back(lib);
// Call startup function
DLL_START_PLUGIN pFunc = (DLL_START_PLUGIN)lib->getSymbol("dllStartPlugin");
if (!pFunc)
TITAN_EXCEPT_FILELOST("Cannot find symbol dllStartPlugin in library " + pluginName);
// This must call installPlugin
pFunc();
}
}