SALOME_NamingService::SALOME_NamingService(CORBA::ORB_ptr orb)
{
MESSAGE("SALOME_NamingService creation");
- _orb = orb ;
+ _orb = CORBA::ORB::_duplicate(orb);
_initialize_root_context();
}
*
* Initializes ORB reference and naming service root context.
* For use after default constructor.
+ * If param orb is null, the orb is initialized
* \param orb CORBA::ORB_ptr arguments
*/
// ============================================================================
MESSAGE("SALOME_NamingService initialisation");
Utils_Locker lock (&_myMutex);
- _orb = orb;
+ if(orb)
+ _orb = CORBA::ORB::_duplicate(orb);
+ else
+ {
+ int argc=0;
+ _orb = CORBA::ORB_init(argc, 0); // Here we make the assumption that the orb has already been initialized
+ }
_initialize_root_context();
}
else
{
SCRUTE(name);
- if (Change_Directory(name.c_str()))
+ string basename = name;
+ if (Change_Directory(basename.c_str()))
{
vector<string> contList = list_subdirs();
if ( !CORBA::is_nil(obj) )
return obj;
+ else
+ Change_Directory(basename.c_str());
}
}
return _orb->object_to_string(_root_context);
}
+/*! \brief get the orb used by the naming service
+ *
+ * \return the orb
+ */
+CORBA::ORB_ptr SALOME_NamingService::orb()
+{
+ return _orb;
+}
+