Salome HOME
Updated copyright comment
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_SObject.cxx
index ff21b6c8e210cec01c5b80ccd4ac0b1d3a44e3ac..97debc4360a9e4487850a4c1bc286a7a4c3b345a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -38,8 +38,7 @@
 #include "SALOMEDSImpl_GenericAttribute.hxx"
 #include "SALOMEDSImpl_Study.hxx"
 
-#include "Utils_ORB_INIT.hxx" 
-#include "Utils_SINGLETON.hxx" 
+#include "OpUtil.hxx"
 
 #include "Basics_Utils.hxx"
 
@@ -196,16 +195,6 @@ bool SALOMEDS_SObject::FindSubObject(int theTag, _PTR(SObject)& theObject)
   return ret;   
 }
 
-_PTR(Study) SALOMEDS_SObject::GetStudy()
-{
-  if (_isLocal) {
-    SALOMEDS::Locker lock;
-    return _PTR(Study)(new SALOMEDS_Study(_local_impl->GetStudy()));
-  }
-  SALOMEDS::Study_var study=_corba_impl->GetStudy();
-  return _PTR(Study)(new SALOMEDS_Study(study));
-}
-
 std::string SALOMEDS_SObject::Name()
 {
   std::string aName;
@@ -236,7 +225,7 @@ std::vector<_PTR(GenericAttribute)> SALOMEDS_SObject::GetAllAttributes()
   if (_isLocal) {
     SALOMEDS::Locker lock;
     std::vector<DF_Attribute*> aSeq = _local_impl->GetAllAttributes();
-    aLength = aSeq.size();
+    aLength = (int)aSeq.size(); //!< TODO: conversion from size_t to int
     for (int i = 0; i < aLength; i++) {
       anAttr = SALOMEDS_GenericAttribute::CreateAttribute(dynamic_cast<SALOMEDSImpl_GenericAttribute*>(aSeq[i]));
       aVector.push_back(_PTR(GenericAttribute)(anAttr));
@@ -299,6 +288,15 @@ int SALOMEDS_SObject::Tag()
   return _corba_impl->Tag(); 
 }
 
+int SALOMEDS_SObject::GetLastChildTag()
+{
+  if (_isLocal) {
+    SALOMEDS::Locker lock;
+    return _local_impl->GetLastChildTag();
+  }
+  return _corba_impl->GetLastChildTag(); 
+}
+
 int SALOMEDS_SObject::Depth()
 {
   if (_isLocal) {
@@ -343,9 +341,7 @@ SALOMEDS::SObject_ptr SALOMEDS_SObject::GetSObject()
 
 void SALOMEDS_SObject::init_orb()
 {
-  ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
-  ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
-  _orb = init(0 , 0 ) ;     
+  _orb = KERNEL::GetRefToORB();    
 }
 
 void SALOMEDS_SObject::SetAttrString(const std::string& name, const std::string& value)