]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Removed method _duplicate from constructors of Clients
authorsrn <srn@opencascade.com>
Wed, 6 Apr 2005 09:12:51 +0000 (09:12 +0000)
committersrn <srn@opencascade.com>
Wed, 6 Apr 2005 09:12:51 +0000 (09:12 +0000)
src/SALOMEDS/Makefile.in
src/SALOMEDS/SALOMEDS_ChildIterator.cxx
src/SALOMEDS/SALOMEDS_GenericAttribute.cxx
src/SALOMEDS/SALOMEDS_SComponentIterator.cxx
src/SALOMEDS/SALOMEDS_SObject.cxx
src/SALOMEDS/SALOMEDS_SObject.hxx
src/SALOMEDS/SALOMEDS_Study.cxx
src/SALOMEDS/SALOMEDS_StudyBuilder.cxx
src/SALOMEDS/SALOMEDS_StudyManager.cxx
src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx
src/SALOMEDS/SALOMEDS_UseCaseIterator.cxx

index 9381217cece3ec06906a8067ae61543c4e6c1f4c..df993d6e5799076529aa3165758a5408bd051756 100644 (file)
@@ -15,9 +15,13 @@ EXPORT_HEADERS= \
        SALOMEDS_StudyManager_i.hxx \
        SALOMEDS_Driver_i.hxx \
        SALOMEDS_StudyManager.hxx \
+       SALOMEDS_Study_i.hxx \
        SALOMEDS_Study.hxx \
+       SALOMEDS_SObject_i.hxx \
        SALOMEDS_SObject.hxx \
+       SALOMEDS_SComponent_i.hxx \
        SALOMEDS_SComponent.hxx \
+       SALOMEDS_GenericAttribute_i.hxx \
        SALOMEDS_GenericAttribute.hxx
 
 # Libraries targets
index d16ef6fe74098a0128868680a988265e7afdf59c..f493fe37620de44d0af3a44381a8fef5514d8afb 100644 (file)
@@ -18,7 +18,7 @@ SALOMEDS_ChildIterator::SALOMEDS_ChildIterator(SALOMEDS::ChildIterator_ptr theIt
 {
   _isLocal = false;
   _local_impl = NULL;
-  _corba_impl = SALOMEDS::ChildIterator::_duplicate(theIterator);
+  _corba_impl = theIterator;
 }
 
 void SALOMEDS_ChildIterator::Init()
index 91ea72dc1f257aeed6d8a3cf05b25e99404c7bd2..a53e7b0df0d4f7c35f7a9660187b7dbda8424383 100644 (file)
@@ -42,7 +42,7 @@ SALOMEDS_GenericAttribute::SALOMEDS_GenericAttribute(SALOMEDS::GenericAttribute_
   }
   else {
     _local_impl = NULL;
-    _corba_impl = SALOMEDS::GenericAttribute::_duplicate(theGA);
+    _corba_impl = theGA;
   }
 }
 
index 59f840c10deaac2f5768af982cbf1cb29128cdbf..93c2becc0ad1c8034b1c4db6961edbb39dae4f13 100644 (file)
@@ -16,7 +16,7 @@ SALOMEDS_SComponentIterator::SALOMEDS_SComponentIterator(const SALOMEDSImpl_SCom
 SALOMEDS_SComponentIterator::SALOMEDS_SComponentIterator(SALOMEDS::SComponentIterator_ptr theIterator)
 {
   _isLocal = false;
-  _corba_impl = SALOMEDS::SComponentIterator::_duplicate(theIterator);
+  _corba_impl = theIterator;
 }
 
 SALOMEDS_SComponentIterator::~SALOMEDS_SComponentIterator()
index 7c6ce7ea72aa2f39cb3f42fc688cadf73c71b39c..17c5af036233781d05b8bfeb45ec09a62d6d32cc 100644 (file)
@@ -39,7 +39,7 @@ SALOMEDS_SObject::SALOMEDS_SObject(SALOMEDS::SObject_ptr theSObject)
   }
   else {
     _local_impl = NULL;
-    _corba_impl = SALOMEDS::SObject::_duplicate(theSObject);
+    _corba_impl = theSObject;
   }
 }
 
@@ -73,13 +73,15 @@ SALOMEDSClient_SObject* SALOMEDS_SObject::GetFather()
   return new SALOMEDS_SObject(_corba_impl->GetFather());
 }
 
-bool SALOMEDS_SObject::FindAttribute(SALOMEDSClient_GenericAttribute* anAttribute, const char* aTypeOfAttribute)
+bool SALOMEDS_SObject::FindAttribute(SALOMEDSClient_GenericAttribute*& anAttribute, const char* aTypeOfAttribute)
 {
   bool ret = false;
   TCollection_AsciiString aType((char*)aTypeOfAttribute);
   if(_isLocal) {
     Handle(SALOMEDSImpl_GenericAttribute) anAttr;
     ret = _local_impl->FindAttribute(anAttr, aType);
+    cout << "############## ret = " << ret << " type requested " << aType << endl;
+    if(!anAttr.IsNull()) cout << "############## recieved " << anAttr->Type() << endl;
     if(ret) anAttribute = SALOMEDS_GenericAttribute::CreateAttribute(anAttr);
   }
   else {
@@ -91,7 +93,7 @@ bool SALOMEDS_SObject::FindAttribute(SALOMEDSClient_GenericAttribute* anAttribut
   return ret;
 }
 
-bool SALOMEDS_SObject::ReferencedObject(SALOMEDSClient_SObject* theObject)
+bool SALOMEDS_SObject::ReferencedObject(SALOMEDSClient_SObject*& theObject)
 {
   bool ret = false;
   if(_isLocal) {
@@ -109,7 +111,7 @@ bool SALOMEDS_SObject::ReferencedObject(SALOMEDSClient_SObject* theObject)
 }
 
 
-bool SALOMEDS_SObject::FindSubObject(int theTag, SALOMEDSClient_SObject* theObject)
+bool SALOMEDS_SObject::FindSubObject(int theTag, SALOMEDSClient_SObject*& theObject)
 {
   bool ret = false;
   if(_isLocal) {
@@ -212,3 +214,16 @@ int SALOMEDS_SObject::Depth()
   if(_isLocal) return _local_impl->Depth();
   return _corba_impl->Depth();  
 }
+
+CORBA::Object_ptr SALOMEDS_SObject::GetObject()
+{
+  CORBA::Object_var obj;
+  if(_isLocal) {
+    TCollection_AsciiString anIOR = GetIOR();
+    SALOMEDS_Study* aStudy = dynamic_cast<SALOMEDS_Study*>(GetStudy());
+    obj = CORBA::Object::_duplicate(aStudy->ConvertIORToObject(anIOR.ToCString()));
+    delete aStudy;
+  }
+  else obj = CORBA::Object::_duplicate(_corba_impl->GetObject());
+  return obj._retn();
+}
index 31369ee34b6e787f02c37785679ed16985f4ed51..11cff215b8302cf4777accd3481c6fb6fe7acbba 100644 (file)
@@ -36,9 +36,9 @@ public:
   virtual char* GetID();
   virtual SALOMEDSClient_SComponent* GetFatherComponent();
   virtual SALOMEDSClient_SObject*    GetFather();
-  virtual bool FindAttribute(SALOMEDSClient_GenericAttribute* anAttribute, const char* aTypeOfAttribute);
-  virtual bool ReferencedObject(SALOMEDSClient_SObject* theObject);
-  virtual bool FindSubObject(int theTag, SALOMEDSClient_SObject* theObject);
+  virtual bool FindAttribute(SALOMEDSClient_GenericAttribute*& anAttribute, const char* aTypeOfAttribute);
+  virtual bool ReferencedObject(SALOMEDSClient_SObject*& theObject);
+  virtual bool FindSubObject(int theTag, SALOMEDSClient_SObject*& theObject);
   virtual SALOMEDSClient_Study* GetStudy();
   virtual char* Name();
   virtual void  Name(const char* theName);
@@ -49,6 +49,7 @@ public:
   virtual int   Tag();
   virtual int   Depth();
 
+  CORBA::Object_ptr GetObject();
   SALOMEDS::SObject_ptr        GetCORBAImpl() { return SALOMEDS::SObject::_duplicate(_corba_impl); }
   Handle(SALOMEDSImpl_SObject) GetLocalImpl() { return _local_impl; }
 };
index 88d5ae603339937113296f7ff3d1c2e9af6562aa..519b5679792396dfeac094c3d2f74d3970b5f714 100644 (file)
@@ -62,7 +62,7 @@ SALOMEDS_Study::SALOMEDS_Study(SALOMEDS::Study_ptr theStudy)
   }
   else {
     _local_impl = NULL;
-    _corba_impl = SALOMEDS::Study::_duplicate(theStudy);
+    _corba_impl = theStudy;
   }
 
   init_orb();
index a952eecd6caf3570dc3b8002805239d62ba7fa62..2c6903c7e8e41e96f8747021c5fbc5c4861cf1c3 100644 (file)
@@ -34,7 +34,7 @@ SALOMEDS_StudyBuilder::SALOMEDS_StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuild
 {
   _isLocal = false;
   _local_impl = NULL;
-  _corba_impl = SALOMEDS::StudyBuilder::_duplicate(theBuilder);
+  _corba_impl = theBuilder;
   init_orb();
 }
 
index fc50e770a555e39f5c78c80995be18743f8eb148..40576276e6b93e8e5cc4e850e323aca674065018 100644 (file)
@@ -37,7 +37,7 @@ SALOMEDS_StudyManager::SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManag
   }
   else {
     _local_impl = NULL;
-    _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
+    _corba_impl = theManager;
   }
 }
 
index 45ce230c726b8fed058b28f6814c791bbee5d6bb..f872d6e7c64fe8f7f88f34db96d4e22db8c3d8dc 100644 (file)
@@ -23,7 +23,7 @@ SALOMEDS_UseCaseBuilder::SALOMEDS_UseCaseBuilder(SALOMEDS::UseCaseBuilder_ptr th
 {
   _isLocal = false;
   _local_impl = NULL;
-  _corba_impl = SALOMEDS::UseCaseBuilder::_duplicate(theBuilder);
+  _corba_impl = theBuilder;
 }
 
 SALOMEDS_UseCaseBuilder::~SALOMEDS_UseCaseBuilder()
index bc809249151a99712102def5f9bb5440733e9028..0d1185097c77b7729c07a9fef6582ea5f2af30f3 100644 (file)
@@ -18,7 +18,7 @@ SALOMEDS_UseCaseIterator::SALOMEDS_UseCaseIterator(SALOMEDS::UseCaseIterator_ptr
 {
   _isLocal = false;
   _local_impl = NULL;
-  _corba_impl = SALOMEDS::UseCaseIterator::_duplicate(theIterator);
+  _corba_impl = theIterator;
 }
 
 SALOMEDS_UseCaseIterator::~SALOMEDS_UseCaseIterator()