本文整理汇总了C++中DynLib类的典型用法代码示例。如果您正苦于以下问题:C++ DynLib类的具体用法?C++ DynLib怎么用?C++ DynLib使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DynLib类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MYGUI_ASSERT
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: DynLib
DynLib* DynLibMgr::load(const char* libName) {
DynLibMap::iterator itr = mDynLibMap.find(libName);
if(itr != mDynLibMap.end()) {
return itr->second;
}
DynLib* lib = NEW DynLib(libName);
lib->load();
mDynLibMap[libName] = lib;
return lib;
}
示例3: DynLib
//-----------------------------------------------------------------------
DynLib* DynLibManager::load( const String& filename)
{
DynLibList::iterator i = mLibList.find(filename);
if (i != mLibList.end())
{
return i->second;
}
else
{
DynLib* pLib = OGRE_NEW DynLib(filename);
pLib->load();
mLibList[filename] = pLib;
return pLib;
}
}
示例4:
/**
* \cond INTERNAL_DOCUMENTATION
*/
PropagatorPlugin::PropagatorPlugin(Plugin *_plugin)
{
plugin = _plugin;
DynLib* handle = plugin->getHandle();
proc_init = (pluginInitFunction)(handle->loadFunction("OPI_Plugin_init", true));
if(proc_init)
{
proc_init(this);
}
proc_propagate = (pluginPropagateFunction)(handle->loadFunction("OPI_Plugin_propagate", true));
setName(plugin->getName());
setAuthor(plugin->getAuthor());
setDescription(plugin->getDescription());
}
示例5: Load
//----------------------------------------------------------------------------
void PluginManager::Load(const std::string &filename)
{
DynLib* lib = DynLibManager::GetSingleton().Load(filename);
mPluginLibs.push_back(lib);
DLL_LOAD_PLUGIN pFunc = (DLL_LOAD_PLUGIN)lib->GetSymbol(
"DLLLoadPlugin");
if (!pFunc)
{
assertion(false, "Cannot find symbol dllStartPlugin in library : %s",
filename.c_str());
}
pFunc();
}
示例6: 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
}
示例7: DynLib
DynLib *
DynLibManager::load(std::string const & path)
{
DynLibMap::iterator loaded = libs.find(path);
if (loaded != libs.end())
{
loaded->second->addRef();
return loaded->second;
}
else
{
DynLib * lib = new DynLib(path);
lib->load();
libs[path] = lib;
return lib;
}
}
示例8: 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();
}
示例9: DynLib
//-------------------------------------------------------------------------------//
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();
}
}
示例10: DynLib
DynLib* DynLibManager::load(const std::string& fileName)
{
StringDynLibMap::iterator it = mLibsMap.find(fileName);
if (it != mLibsMap.end())
{
return it->second;
}
DynLib* pLib = new DynLib(fileName);
if (!pLib->load())
{
delete pLib;
return 0;
}
mLibsMap[fileName] = pLib;
return pLib;
}