X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_PluginManager.cpp;h=a8d497c7c6986d6146148f7d525e83c54b09374d;hb=5dfed65281f80488610fa9817350611277c6b0aa;hp=772ac8d9888b4ea4ac3893c5ca1e1c4cebf20d7c;hpb=6654a921211670c15a79a997ca666a174fe8a6f6;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_PluginManager.cpp b/src/ModelAPI/ModelAPI_PluginManager.cpp index 772ac8d98..a8d497c7c 100644 --- a/src/ModelAPI/ModelAPI_PluginManager.cpp +++ b/src/ModelAPI/ModelAPI_PluginManager.cpp @@ -7,17 +7,19 @@ #include // to avoid unresolved ModelAPI_Feature() #include +#include // to avoid unresolved ModelAPI_Data() #include // to avoid unresolved ModelAPI_Plugin() #include -// to avoid unresolved ModelAPI_Iterator() -#include -// to avoid unresolved ModelAPI_Iterator() -#include #include #include #include +#include +#include +#include + +#include #ifdef WIN32 #include @@ -27,8 +29,9 @@ using namespace std; -/// Converts library name to the operation system file name -string library(const string& theLibName); +#ifdef _DEBUG +#include +#endif /// Manager that will be initialized from Model package, one per application boost::shared_ptr MY_MANAGER; @@ -46,49 +49,10 @@ void ModelAPI_PluginManager::SetPluginManager( boost::shared_ptr ModelAPI_PluginManager::get() { if (!MY_MANAGER) { // import Model library that implements this interface of ModelAPI - loadLibrary("Model"); + #ifdef _DEBUG + std::cout << "ModelAPI_PluginManager::get: " << "Model library has not been loaded from xml." << std::endl; + #endif + Config_ModuleReader::loadLibrary("Model"); } return MY_MANAGER; } - -string library(const string& theLibName) -{ - string aLibName = theLibName; - -#ifndef WIN32 - static string aLibExt( ".so" ); - if (aLibName.size() < 3 || aLibName.substr(0, 3) !="lib") - aLibName = "lib" + aLibName; -#else - static string aLibExt( ".dll" ); -#endif - - string anExt = aLibName.substr(aLibName.size() - 4); - - if ( anExt != aLibExt) - aLibName += aLibExt; - - return aLibName; -} - -// for debug purpose only (cerr), before the error management system is implemented -#include -void ModelAPI_PluginManager::loadLibrary(const string theLibName) -{ - string aFileName = library(theLibName); - if ( aFileName.empty() ) - { - cerr<<"Library "<