]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: remove argument library name (always libCOMPONENTEngine.so)
authorprascle <prascle>
Thu, 12 May 2005 11:18:44 +0000 (11:18 +0000)
committerprascle <prascle>
Thu, 12 May 2005 11:18:44 +0000 (11:18 +0000)
src/Container/Container_i.cxx
src/Container/SALOME_Container_i.hxx
src/LifeCycleCORBA/SALOME_LifeCycleCORBA.cxx
src/TestContainer/TestContainer.cxx

index 1402a3c80085566768a79862d7b73b7f42749899..5cc7350ff93eb2f2ab1ab59e5c4c9f616f44191e 100644 (file)
@@ -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();
 }
     
index 0791322edc0d81502cc78e8d25f624cf6098005f..a3840cfb615f83c6280ae1b89f432c02260f998d 100644 (file)
@@ -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
index 00dfee502b12d2bf189e08607f368e5fc23a6a6d..1af1f64e6fd29325fc42eb6759c70d291ce79eeb 100644 (file)
@@ -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,"");
 }
 
 
index 4bd9135fe320ded562add23a8d657c3737429568..2e0c484b8cbaf22c422ac163c2186a0c89ace9bd 100644 (file)
@@ -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");