From: prascle Date: Thu, 12 May 2005 11:18:44 +0000 (+0000) Subject: PR: remove argument library name (always libCOMPONENTEngine.so) X-Git-Tag: BR_V220_LifeCycle_20050520~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=28d74e394334f55e783ba68bac6bb5a7feecb886;p=modules%2Fkernel.git PR: remove argument library name (always libCOMPONENTEngine.so) --- diff --git a/src/Container/Container_i.cxx b/src/Container/Container_i.cxx index 1402a3c80..5cc7350ff 100644 --- a/src/Container/Container_i.cxx +++ b/src/Container/Container_i.cxx @@ -223,16 +223,18 @@ void Engines_Container_i::Shutdown() //============================================================================= /*! - * CORBA method: load a new component class (dynamic library) - * \param componentLibraryName like "libCOMPONENTEngine.so" + * CORBA method: load a new component class (Python or C++ implementation) + * \param componentName like COMPONENT + * try to make a Python import of COMPONENT, + * then a lib open of libCOMPONENTEngine.so * \return true if dlopen successfull or already done, false otherwise */ //============================================================================= bool -Engines_Container_i::load_component_Library(const char* componentLibraryName) +Engines_Container_i::load_component_Library(const char* componentName) { - string impl_name = componentLibraryName; + string impl_name = string ("lib") + componentName + string("Engine.so"); SCRUTE(impl_name); _numInstanceMutex.lock(); // lock to be alone @@ -268,7 +270,6 @@ Engines_Container_i::load_component_Library(const char* componentLibraryName) * The servant registers itself to naming service and Registry. * \param genericRegisterName Name of the component instance to register * in Registry & Name Service (without _inst_n suffix) - * \param componentName Name of the constructed library of the component * \param studyId 0 for multiStudy instance, * study Id (>0) otherwise * \return a loaded component @@ -277,7 +278,6 @@ Engines_Container_i::load_component_Library(const char* componentLibraryName) Engines::Component_ptr Engines_Container_i::create_component_instance(const char*genericRegisterName, - const char*componentLibraryName, CORBA::Long studyId) { if (studyId < 0) @@ -286,7 +286,7 @@ Engines_Container_i::create_component_instance(const char*genericRegisterName, return Engines::Component::_nil() ; } - string impl_name = componentLibraryName; + string impl_name = string ("lib") + genericRegisterName +string("Engine.so"); void* handle = _library_map[impl_name]; if ( !handle ) { @@ -354,9 +354,10 @@ Engines::Component_ptr Engines_Container_i::load_impl( const char* genericRegisterName, const char* componentName ) { + string impl_name = string ("lib") + genericRegisterName +string("Engine.so"); Engines::Component_var iobject = Engines::Component::_nil() ; - if (load_component_Library(componentName)) - iobject = find_or_create_instance(genericRegisterName, componentName); + if (load_component_Library(genericRegisterName)) + iobject = find_or_create_instance(genericRegisterName, impl_name); return iobject._retn(); } diff --git a/src/Container/SALOME_Container_i.hxx b/src/Container/SALOME_Container_i.hxx index 0791322ed..a3840cfb6 100644 --- a/src/Container/SALOME_Container_i.hxx +++ b/src/Container/SALOME_Container_i.hxx @@ -58,11 +58,10 @@ public: // --- CORBA methods - bool load_component_Library(const char* componentLibraryName); + bool load_component_Library(const char* componentName); Engines::Component_ptr - create_component_instance( const char* nameToRegister, - const char* componentLibraryName, + create_component_instance( const char* componentName, CORBA::Long studyId); // 0 for multiStudy Engines::Component_ptr diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx index 00dfee502..1af1f64e6 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx @@ -369,8 +369,9 @@ SALOME_LifeCycleCORBA::LoadComponent(const char *containerName, { Engines::Container_var cont=_ContManager->FindOrStartContainer(containerName, listOfMachines); - string implementation=Engines_Component_i::GetDynLibraryName(componentName); - return cont->load_impl(componentName, implementation.c_str()); + //string implementation=Engines_Component_i::GetDynLibraryName(componentName); + //return cont->load_impl(componentName, implementation.c_str()); + return cont->load_impl(componentName,""); } diff --git a/src/TestContainer/TestContainer.cxx b/src/TestContainer/TestContainer.cxx index 4bd9135fe..2e0c484b8 100644 --- a/src/TestContainer/TestContainer.cxx +++ b/src/TestContainer/TestContainer.cxx @@ -63,11 +63,10 @@ static ostream& operator<<(ostream& os, const CORBA::Exception& e) Engines::TestComponent_ptr create_intance(Engines::Container_ptr iGenFact) { bool isLib = - iGenFact->load_component_Library("libSalomeTestComponentEngine.so"); + iGenFact->load_component_Library("SalomeTestComponent"); ASSERT(isLib); CORBA::Object_var obj = iGenFact->create_component_instance("SalomeTestComponent", - "libSalomeTestComponentEngine.so", 0); Engines::TestComponent_var anInstance = Engines::TestComponent::_narrow(obj); MESSAGE("create anInstance");