map<string, DF_Attribute*>::iterator mi;
for(mi =_node->_attributes.begin(); mi != _node->_attributes.end(); mi++) {
if(mi->second == this) {
- _node->_attributes.erase(mi);
- }
+ _node->_attributes.erase(mi);
+ return;
+ }
}
}
}
delete vn[i];
_root._node->Reset();
- delete _root._node;
+ _root.Nullify();
}
//Returns true if this document is empty
char **argv = &xargv;
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
// LocalTraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
+ _NSnew=0;
if (!ns)
{
_NS = new SALOME_NamingService(orb);
+ _NSnew=_NS;
}
else _NS = ns;
//add try catch
SALOME_LifeCycleCORBA::~SALOME_LifeCycleCORBA()
{
+ if(_NSnew)delete _NSnew;
}
//=============================================================================
containerDest->copyFile(containerSrc,fileSrc,fileDest);
}
+/*! \brief get the naming service used by the life cycle
+ *
+ * \return the naming service
+ */
+SALOME_NamingService * SALOME_LifeCycleCORBA::namingService()
+{
+ return _NS;
+}
+
+/*! \brief get the orb used by the life cycle
+ *
+ * \return the orb
+ */
+CORBA::ORB_ptr SALOME_LifeCycleCORBA::orb()
+{
+ return _NS->orb();
+}
+
Engines::ContainerManager_ptr getContainerManager();
Engines::ResourcesManager_ptr getResourcesManager();
+ SALOME_NamingService * namingService();
+ CORBA::ORB_ptr orb();
void copyFile(const char* hostSrc, const char* fileSrc, const char* hostDest, const char* fileDest);
void shutdownServers();
int studyId);
SALOME_NamingService *_NS;
+ SALOME_NamingService *_NSnew;
Engines::ContainerManager_var _ContManager;
Engines::ResourcesManager_var _ResManager;
*
* 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 = CORBA::ORB::_duplicate(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();
}
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;
+}
+
virtual ~SALOME_NamingService();
- void init_orb(CORBA::ORB_ptr orb);
+ void init_orb(CORBA::ORB_ptr orb=0);
void Register(CORBA::Object_ptr ObjRef,
const char* Path)
throw(ServiceUnreachable);
virtual void Destroy_FullDirectory(const char* Path)
throw(ServiceUnreachable);
char* getIORaddr();
+ CORBA::ORB_ptr orb();
protected:
Utils_Mutex _myMutex;