From 6d2e58068815e12afc9c45a98cf5c88254b6df95 Mon Sep 17 00:00:00 2001 From: rnv Date: Mon, 15 Apr 2019 14:02:07 +0300 Subject: [PATCH] Multi-study removal completion --- idl/SALOMEDS.idl | 9 +-- src/KERNEL_PY/__init__.py | 8 +- src/KERNEL_PY/salome_study.py | 2 - src/SALOMEDS/SALOMEDS_Driver_i.cxx | 7 +- src/SALOMEDS/SALOMEDS_Driver_i.hxx | 2 +- src/SALOMEDS/SALOMEDS_Study.cxx | 8 -- src/SALOMEDS/SALOMEDS_Study.hxx | 1 - src/SALOMEDS/SALOMEDS_Study_i.cxx | 74 +++++++------------ src/SALOMEDS/SALOMEDS_Study_i.hxx | 4 +- .../Test/SALOMEDSTest_AttributeComment.cxx | 2 - .../Test/SALOMEDSTest_AttributeDrawable.cxx | 2 - .../Test/SALOMEDSTest_AttributeExpandable.cxx | 2 - .../SALOMEDSTest_AttributeExternalFileDef.cxx | 2 - .../Test/SALOMEDSTest_AttributeFileType.cxx | 2 - .../Test/SALOMEDSTest_AttributeFlags.cxx | 2 - .../Test/SALOMEDSTest_AttributeGraphic.cxx | 2 - .../Test/SALOMEDSTest_AttributeIOR.cxx | 2 - .../Test/SALOMEDSTest_AttributeInteger.cxx | 2 - .../Test/SALOMEDSTest_AttributeLocalID.cxx | 2 - .../Test/SALOMEDSTest_AttributeName.cxx | 2 - .../Test/SALOMEDSTest_AttributeOpened.cxx | 2 - .../Test/SALOMEDSTest_AttributeParameter.cxx | 2 - .../SALOMEDSTest_AttributePersistentRef.cxx | 2 - .../Test/SALOMEDSTest_AttributePixMap.cxx | 2 - .../SALOMEDSTest_AttributePythonObject.cxx | 2 - .../Test/SALOMEDSTest_AttributeReal.cxx | 2 - .../Test/SALOMEDSTest_AttributeSelectable.cxx | 2 - ...ALOMEDSTest_AttributeSequenceOfInteger.cxx | 2 - .../SALOMEDSTest_AttributeSequenceOfReal.cxx | 2 - .../SALOMEDSTest_AttributeStudyProperties.cxx | 2 - .../SALOMEDSTest_AttributeTableOfInteger.cxx | 2 - .../SALOMEDSTest_AttributeTableOfReal.cxx | 2 - .../SALOMEDSTest_AttributeTableOfString.cxx | 2 - .../Test/SALOMEDSTest_AttributeTarget.cxx | 2 - .../Test/SALOMEDSTest_AttributeTextColor.cxx | 2 - ...LOMEDSTest_AttributeTextHighlightColor.cxx | 2 - .../Test/SALOMEDSTest_AttributeTreeNode.cxx | 2 - .../Test/SALOMEDSTest_AttributeUserID.cxx | 1 - .../Test/SALOMEDSTest_ChildIterator.cxx | 2 - src/SALOMEDS/Test/SALOMEDSTest_SComponent.cxx | 2 - .../Test/SALOMEDSTest_SComponentIterator.cxx | 2 - src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx | 2 - .../Test/SALOMEDSTest_StudyBuilder.cxx | 2 - src/SALOMEDS/Test/SALOMEDSTest_UseCase.cxx | 2 - src/SALOMEDSClient/SALOMEDSClient_Study.hxx | 1 - src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx | 2 +- 46 files changed, 40 insertions(+), 147 deletions(-) diff --git a/idl/SALOMEDS.idl b/idl/SALOMEDS.idl index 5ddf9b081..4283073e8 100644 --- a/idl/SALOMEDS.idl +++ b/idl/SALOMEDS.idl @@ -559,14 +559,10 @@ Searches for a definite %SObject with a definite GUID and returns True if it fin */ UseCaseBuilder GetUseCaseBuilder() raises(StudyInvalidReference); -/*! \brief Clear a study object +/*! \brief Clear the previous and initialize new empty study object */ void Clear() raises(StudyInvalidReference); -/*! \brief Initialization a study object -*/ - void Init() raises(StudyInvalidReference); - /*! \brief Open a study by url Reads and activates the structure of the study %Objects. @@ -1281,8 +1277,7 @@ can be called by any component and which provide the following functionality: \param aSComponent The according %SComponent */ - void Close (in SComponent aSComponent); - //void Close ( in string aIORSComponent); + void Close (); /*! Gets the type of the data diff --git a/src/KERNEL_PY/__init__.py b/src/KERNEL_PY/__init__.py index 0d2f77497..3fa260c47 100644 --- a/src/KERNEL_PY/__init__.py +++ b/src/KERNEL_PY/__init__.py @@ -207,11 +207,11 @@ def salome_init(path=None, embedded=False): def salome_close(): global salome_initial, myStudy, myStudyName - try: + #try: # study can be clear either from GUI or directly with salome.myStudy.Clear() - myStudy.Clear() - except: - pass + # myStudy.Clear() + #except: + # pass salome_initial=True salome_iapp_close() salome_study_close() diff --git a/src/KERNEL_PY/salome_study.py b/src/KERNEL_PY/salome_study.py index 67f3c9db0..61b1db435 100644 --- a/src/KERNEL_PY/salome_study.py +++ b/src/KERNEL_PY/salome_study.py @@ -306,8 +306,6 @@ def salome_study_init(theStudyPath=None): if isinstance(theStudyPath, bytes): theStudyPath = str(theStudyPath, 'UTF8') openStudy(theStudyPath) - else: - myStudy.Init() myStudyName = myStudy._get_Name() diff --git a/src/SALOMEDS/SALOMEDS_Driver_i.cxx b/src/SALOMEDS/SALOMEDS_Driver_i.cxx index 0df750250..c5d93eb93 100644 --- a/src/SALOMEDS/SALOMEDS_Driver_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Driver_i.cxx @@ -165,14 +165,11 @@ bool SALOMEDS_Driver_i::LoadASCII(const SALOMEDSImpl_SComponent& theComponent, return isOk; } -void SALOMEDS_Driver_i::Close(const SALOMEDSImpl_SComponent& theComponent) +void SALOMEDS_Driver_i::Close() { - SALOMEDS::SComponent_var sco = SALOMEDS_SComponent_i::New (theComponent, _orb); - SALOMEDS::unlock(); if ( !CORBA::is_nil(_driver) ) - _driver->Close(sco.in()); - sco->UnRegister(); + _driver->Close(); SALOMEDS::lock(); } diff --git a/src/SALOMEDS/SALOMEDS_Driver_i.hxx b/src/SALOMEDS/SALOMEDS_Driver_i.hxx index bb6ea4aa7..bc0c1ea57 100644 --- a/src/SALOMEDS/SALOMEDS_Driver_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Driver_i.hxx @@ -69,7 +69,7 @@ public: const std::string& theURL, bool isMultiFile); - virtual void Close(const SALOMEDSImpl_SComponent& theComponent); + virtual void Close(); virtual std::string ComponentDataType(); diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index 2a14971d7..47e96ed79 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -110,14 +110,6 @@ void SALOMEDS_Study::InitORB() _orb = init(0 , 0 ) ; } -void SALOMEDS_Study::Init() -{ - if(CORBA::is_nil(_corba_impl)) - return; - - _corba_impl->Init(); -} - void SALOMEDS_Study::Clear() { if(CORBA::is_nil(_corba_impl)) diff --git a/src/SALOMEDS/SALOMEDS_Study.hxx b/src/SALOMEDS/SALOMEDS_Study.hxx index c6dc58486..ac1a6b30e 100644 --- a/src/SALOMEDS/SALOMEDS_Study.hxx +++ b/src/SALOMEDS/SALOMEDS_Study.hxx @@ -53,7 +53,6 @@ public: ~SALOMEDS_Study(); virtual void Clear(); - virtual void Init(); virtual bool Open(const std::string& theStudyUrl); diff --git a/src/SALOMEDS/SALOMEDS_Study_i.cxx b/src/SALOMEDS/SALOMEDS_Study_i.cxx index 6573f4e0d..f4f7bb37e 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.cxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.cxx @@ -258,7 +258,7 @@ SALOMEDS_Study_i::SALOMEDS_Study_i(CORBA::ORB_ptr orb) _factory = new SALOMEDS_DriverFactory_i(_orb); _closed = true; - Init(); + Clear(); } //============================================================================ @@ -268,7 +268,7 @@ SALOMEDS_Study_i::SALOMEDS_Study_i(CORBA::ORB_ptr orb) //============================================================================ SALOMEDS_Study_i::~SALOMEDS_Study_i() { - Clear(); + Clear_internal(); delete _factory; delete _impl; } @@ -278,8 +278,9 @@ SALOMEDS_Study_i::~SALOMEDS_Study_i() * Purpose : Initialize study components */ //============================================================================ -void SALOMEDS_Study_i::Init() +void SALOMEDS_Study_i::Clear() { + Clear_internal(); if (!_closed) //throw SALOMEDS::Study::StudyInvalidReference(); return; @@ -309,54 +310,37 @@ void SALOMEDS_Study_i::Init() * Purpose : Clear study components */ //============================================================================ -void SALOMEDS_Study_i::Clear() +void SALOMEDS_Study_i::Clear_internal() { if (_closed) return; SALOMEDS::Locker lock; - - //delete the builder servant - PortableServer::POA_var poa=_default_POA(); - PortableServer::ObjectId_var anObjectId = poa->servant_to_id(_builder); - poa->deactivate_object(anObjectId.in()); - _builder->_remove_ref(); + if (_builder) { + //delete the builder servant + PortableServer::POA_var poa=_default_POA(); + PortableServer::ObjectId_var anObjectId = poa->servant_to_id(_builder); + poa->deactivate_object(anObjectId.in()); + _builder->_remove_ref(); + } RemovePostponed(-1); - if (_impl->GetDocument()) { - SALOMEDS::SComponentIterator_var itcomponent = NewComponentIterator(); - for (; itcomponent->More(); itcomponent->Next()) { - SALOMEDS::SComponent_var sco = itcomponent->Value(); - CORBA::String_var compodatatype=sco->ComponentDataType(); - MESSAGE ( "Look for an engine for data type :"<< compodatatype); - // if there is an associated Engine call its method for closing - CORBA::String_var IOREngine; - if (sco->ComponentIOR(IOREngine)) { - // we have found the associated engine to write the data - MESSAGE ( "We have found an engine for data type :"<< compodatatype); - //_narrow can throw a corba exception - try { - CORBA::Object_var obj = _orb->string_to_object(IOREngine); - if (!CORBA::is_nil(obj)) { - SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_narrow(obj) ; - if (!anEngine->_is_nil()) { - SALOMEDS::unlock(); - anEngine->Close(sco); - SALOMEDS::lock(); - } - } - } - catch (CORBA::Exception&) { - } + SALOME_NamingService *aNamingService = KERNEL::getNamingService(); + if( aNamingService->Change_Directory("/Containers") ) { + + std::vector dirContent = aNamingService->list_directory_recurs(); + for( std::vector::iterator iter = dirContent.begin(); iter!=dirContent.end(); iter++ ) { + CORBA::Object_var obj = aNamingService->Resolve( ( *iter ).c_str() ); + SALOMEDS::Driver_var anEngine = SALOMEDS::Driver::_narrow(obj) ; + if ( !CORBA::is_nil( anEngine ) ) { + SALOMEDS::unlock(); + anEngine->Close(); + SALOMEDS::lock(); } - sco->UnRegister(); } - - //Does not need any more this iterator - itcomponent->UnRegister(); } - + // Notify GUI that study is cleared SALOMEDS::sendMessageToGUI( "studyCleared" ); @@ -395,8 +379,7 @@ bool SALOMEDS_Study_i::Open(const wchar_t* aWUrl) throw(SALOME::SALOME_Exception) { if (!_closed) - Clear(); - Init(); + Clear(); SALOMEDS::Locker lock; Unexpect aCatch(SalomeException); @@ -1050,9 +1033,6 @@ SALOMEDS::UseCaseBuilder_ptr SALOMEDS_Study_i::GetUseCaseBuilder() { SALOMEDS::Locker lock; - if (_closed) - throw SALOMEDS::Study::StudyInvalidReference(); - SALOMEDS_UseCaseBuilder_i* UCBuilder = new SALOMEDS_UseCaseBuilder_i(_impl->GetUseCaseBuilder(), _orb); SALOMEDS::UseCaseBuilder_var uc = UCBuilder->_this(); return uc._retn(); @@ -1084,8 +1064,8 @@ void SALOMEDS_Study_i::RemovePostponed(CORBA::Long /*theUndoLimit*/) { SALOMEDS::Locker lock; - if (_closed) - throw SALOMEDS::Study::StudyInvalidReference(); + // if (_closed) + // throw SALOMEDS::Study::StudyInvalidReference(); std::vector anIORs = _impl->GetIORs(); int i, aSize = (int)anIORs.size(); diff --git a/src/SALOMEDS/SALOMEDS_Study_i.hxx b/src/SALOMEDS/SALOMEDS_Study_i.hxx index f16e029a7..87a44616e 100644 --- a/src/SALOMEDS/SALOMEDS_Study_i.hxx +++ b/src/SALOMEDS/SALOMEDS_Study_i.hxx @@ -71,7 +71,6 @@ public: virtual PortableServer::POA_ptr _default_POA(); - virtual void Init(); virtual void Clear(); //! method to Open a Study @@ -348,5 +347,8 @@ public: virtual void attach(SALOMEDS::Observer_ptr theObs, CORBA::Boolean modify); virtual void detach(SALOMEDS::Observer_ptr theObs); + + private: + void Clear_internal(); //Internal method }; #endif diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeComment.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeComment.cxx index 216a85c9e..1717a63ee 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeComment.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeComment.cxx @@ -64,8 +64,6 @@ void SALOMEDSTest::testAttributeComment() //Try to set empty string _attr->SetValue(""); CPPUNIT_ASSERT(_attr->Value() == ""); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeDrawable.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeDrawable.cxx index a1c4dc051..508542542 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeDrawable.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeDrawable.cxx @@ -61,8 +61,6 @@ void SALOMEDSTest::testAttributeDrawable() _attr->SetDrawable(false); CPPUNIT_ASSERT(!_attr->IsDrawable()); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeExpandable.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeExpandable.cxx index c312a38b8..99491f2ba 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeExpandable.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeExpandable.cxx @@ -60,8 +60,6 @@ void SALOMEDSTest::testAttributeExpandable() _attr->SetExpandable(true); CPPUNIT_ASSERT(_attr->IsExpandable()); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeExternalFileDef.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeExternalFileDef.cxx index f371ce8cf..a3fb70ef1 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeExternalFileDef.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeExternalFileDef.cxx @@ -62,8 +62,6 @@ void SALOMEDSTest::testAttributeExternalFileDef() //Try to set empty string _attr->SetValue(""); CPPUNIT_ASSERT(_attr->Value() == ""); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeFileType.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeFileType.cxx index 4ba73baf8..b0aa4dfc7 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeFileType.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeFileType.cxx @@ -62,8 +62,6 @@ void SALOMEDSTest::testAttributeFileType() //Try to set empty string _attr->SetValue(""); CPPUNIT_ASSERT(_attr->Value() == ""); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeFlags.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeFlags.cxx index 1be881fad..a86bf4bde 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeFlags.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeFlags.cxx @@ -65,8 +65,6 @@ void SALOMEDSTest::testAttributeFlags() CPPUNIT_ASSERT(_attr->Get(2)); CPPUNIT_ASSERT(!_attr->Get(4)); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeGraphic.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeGraphic.cxx index a143463fa..8216c8d56 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeGraphic.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeGraphic.cxx @@ -62,8 +62,6 @@ void SALOMEDSTest::testAttributeGraphic() CPPUNIT_ASSERT(!_attr->GetVisibility(0)); _attr->SetVisibility(-1, true); CPPUNIT_ASSERT(_attr->GetVisibility(-1)); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeIOR.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeIOR.cxx index 86d6a88fc..86cb5f9bc 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeIOR.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeIOR.cxx @@ -58,8 +58,6 @@ void SALOMEDSTest::testAttributeIOR() _attr->SetValue(ior); CPPUNIT_ASSERT(ior == _attr->Value()); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeInteger.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeInteger.cxx index e7adebf75..3d46998e2 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeInteger.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeInteger.cxx @@ -54,8 +54,6 @@ void SALOMEDSTest::testAttributeInteger() //Check method Value CPPUNIT_ASSERT(_attr->Value() == value); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeLocalID.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeLocalID.cxx index 70dc927ad..865204199 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeLocalID.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeLocalID.cxx @@ -54,8 +54,6 @@ void SALOMEDSTest::testAttributeLocalID() //Check method Value CPPUNIT_ASSERT(_attr->Value() == value); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeName.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeName.cxx index 4db26a6d3..5bdd361ad 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeName.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeName.cxx @@ -62,8 +62,6 @@ void SALOMEDSTest::testAttributeName() //Try to set empty string _attr->SetValue(""); CPPUNIT_ASSERT(_attr->Value() == ""); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeOpened.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeOpened.cxx index eee9f44c3..4b0628706 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeOpened.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeOpened.cxx @@ -60,8 +60,6 @@ void SALOMEDSTest::testAttributeOpened() _attr->SetOpened(false); CPPUNIT_ASSERT(!_attr->IsOpened()); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeParameter.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeParameter.cxx index f384dc402..5c85ec7d2 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeParameter.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeParameter.cxx @@ -135,8 +135,6 @@ void SALOMEDSTest::testAttributeParameter() CPPUNIT_ASSERT(_attr->IsSet("StrArray", PT_STRARRAY) && _attr->GetStrArray("StrArray")[0] == "hello"); CPPUNIT_ASSERT(_attr->IsSet("StrArray", PT_STRARRAY) && _attr->GetStrArray("StrArray")[1] == "world"); */ - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributePersistentRef.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributePersistentRef.cxx index a75ee44cc..243adc52f 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributePersistentRef.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributePersistentRef.cxx @@ -62,8 +62,6 @@ void SALOMEDSTest::testAttributePersistentRef() //Try to set empty string _attr->SetValue(""); CPPUNIT_ASSERT(_attr->Value() == ""); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributePixMap.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributePixMap.cxx index 80e198518..6fdb4ec55 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributePixMap.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributePixMap.cxx @@ -62,8 +62,6 @@ void SALOMEDSTest::testAttributePixMap() //Check empty PixMap assigning and retrieval _attr->SetPixMap(""); CPPUNIT_ASSERT(_attr->GetPixMap() == ""); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributePythonObject.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributePythonObject.cxx index 523b5bc54..542161b7b 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributePythonObject.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributePythonObject.cxx @@ -63,8 +63,6 @@ void SALOMEDSTest::testAttributePythonObject() //Check setting and retrieval of empty object _attr->SetObject("", true); CPPUNIT_ASSERT(_attr->GetObject() == "" && _attr->IsScript()); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeReal.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeReal.cxx index 2ecf017b4..09f8c4cfc 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeReal.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeReal.cxx @@ -54,8 +54,6 @@ void SALOMEDSTest::testAttributeReal() //Check method Value CPPUNIT_ASSERT(_attr->Value() == value); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSelectable.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSelectable.cxx index 03c3effc7..c5f4d35e3 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSelectable.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSelectable.cxx @@ -60,8 +60,6 @@ void SALOMEDSTest::testAttributeSelectable() _attr->SetSelectable(true); CPPUNIT_ASSERT(_attr->IsSelectable()); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx index 03cbb42bb..2b9a695f2 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfInteger.cxx @@ -116,8 +116,6 @@ void SALOMEDSTest::testAttributeSequenceOfInteger() isRaised = true; } CPPUNIT_ASSERT(isRaised); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfReal.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfReal.cxx index f378a3481..c7cba8df9 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfReal.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeSequenceOfReal.cxx @@ -110,8 +110,6 @@ void SALOMEDSTest::testAttributeSequenceOfReal() isRaised = true; } CPPUNIT_ASSERT(isRaised); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeStudyProperties.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeStudyProperties.cxx index 86dd91197..67489986c 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeStudyProperties.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeStudyProperties.cxx @@ -102,8 +102,6 @@ void SALOMEDSTest::testAttributeStudyProperties() _attr->GetModificationsList(vs, vi[0], vi[1], vi[2], vi[3], vi[4], true); CPPUNIT_ASSERT(vs[0] == "srn" && vi[0][0] == 1 && vi[1][0] == 2 && vi[2][0] == 3 && vi[3][0] == 4 && vi[4][0] == 5); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfInteger.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfInteger.cxx index a6c431596..f3e5e825e 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfInteger.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfInteger.cxx @@ -179,8 +179,6 @@ void SALOMEDSTest::testAttributeTableOfInteger() data2 = _attr->GetColumn(3); CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == 11 && data2[1] == -22 && data2[2] == -33); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfReal.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfReal.cxx index add4454b2..21993410b 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfReal.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfReal.cxx @@ -178,8 +178,6 @@ void SALOMEDSTest::testAttributeTableOfReal() data2 = _attr->GetColumn(3); CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == 11.11 && data2[1] == -22.22 && data2[2] == -33.33); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfString.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfString.cxx index 9f89579d0..9c93baa39 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfString.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTableOfString.cxx @@ -179,8 +179,6 @@ void SALOMEDSTest::testAttributeTableOfString() data2 = _attr->GetColumn(3); CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == "11" && data2[1] == "-22" && data2[2] == "-33"); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTarget.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTarget.cxx index 0868f3d5a..e80498321 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTarget.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTarget.cxx @@ -78,8 +78,6 @@ void SALOMEDSTest::testAttributeTarget() CPPUNIT_ASSERT(v.size() == 1); CPPUNIT_ASSERT(v[0]->GetID() == "0:1:3"); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTextColor.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTextColor.cxx index e517a9793..c4678198e 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTextColor.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTextColor.cxx @@ -63,8 +63,6 @@ void SALOMEDSTest::testAttributeTextColor() CPPUNIT_ASSERT(color.G == color2.G); CPPUNIT_ASSERT(color.B == color2.B); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTextHighlightColor.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTextHighlightColor.cxx index 258cd030c..265daa58f 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTextHighlightColor.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTextHighlightColor.cxx @@ -63,8 +63,6 @@ void SALOMEDSTest::testAttributeTextHighlightColor() CPPUNIT_ASSERT(color.G == color2.G); CPPUNIT_ASSERT(color.B == color2.B); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTreeNode.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTreeNode.cxx index aef41d615..d335f8310 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeTreeNode.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeTreeNode.cxx @@ -184,8 +184,6 @@ void SALOMEDSTest::testAttributeTreeNode() std::string value = "0e1c36e6-1111-4d90-ab3b-18a14310e648"; _PTR(AttributeTreeNode) _attr_guid = studyBuilder->FindOrCreateAttribute(so, "AttributeTreeNodeGUID"+value); CPPUNIT_ASSERT(_attr_guid && _attr_guid->GetTreeID() == value); - - study->Clear(); } #undef SALOMEDS_ALL_TESTS diff --git a/src/SALOMEDS/Test/SALOMEDSTest_AttributeUserID.cxx b/src/SALOMEDS/Test/SALOMEDSTest_AttributeUserID.cxx index 7809c3006..0bc8122b7 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_AttributeUserID.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_AttributeUserID.cxx @@ -60,7 +60,6 @@ void SALOMEDSTest::testAttributeUserID() _PTR(AttributeUserID) _attr2 = studyBuilder->FindOrCreateAttribute(so, "AttributeUserID"+value); CPPUNIT_ASSERT(_attr2 && _attr2->Value() == value); - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_ChildIterator.cxx b/src/SALOMEDS/Test/SALOMEDSTest_ChildIterator.cxx index f4f5ea724..75b546b1b 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_ChildIterator.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_ChildIterator.cxx @@ -68,8 +68,6 @@ void SALOMEDSTest::testChildIterator() //Check that there are two SObject under so CPPUNIT_ASSERT(count == 2); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_SComponent.cxx b/src/SALOMEDS/Test/SALOMEDSTest_SComponent.cxx index 402942c46..d649cd90e 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_SComponent.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_SComponent.cxx @@ -59,8 +59,6 @@ void SALOMEDSTest::testSComponent() //Check method ComponentDataType CPPUNIT_ASSERT(sco->ComponentDataType() == "Test"); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_SComponentIterator.cxx b/src/SALOMEDS/Test/SALOMEDSTest_SComponentIterator.cxx index be3080c14..11ad117ed 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_SComponentIterator.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_SComponentIterator.cxx @@ -54,8 +54,6 @@ void SALOMEDSTest::testSComponentIterator() CPPUNIT_ASSERT(i<2); CPPUNIT_ASSERT(ci->Value()->ComponentDataType() == v[i]); } - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx b/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx index df77f36b1..32ae88d52 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx @@ -111,8 +111,6 @@ void SALOMEDSTest::testSObject() //Check method GetObject CORBA::Object_var obj = dynamic_cast(so.get())->GetObject(); CPPUNIT_ASSERT(!CORBA::is_nil(obj)); - - study->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx b/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx index 8732c7163..5604345d9 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx @@ -210,6 +210,4 @@ void SALOMEDSTest::testStudyBuilder() CPPUNIT_ASSERT(!ior.empty()); system("rm -f srn_SALOMEDS_UnitTests.hdf"); - - study3->Clear(); } diff --git a/src/SALOMEDS/Test/SALOMEDSTest_UseCase.cxx b/src/SALOMEDS/Test/SALOMEDSTest_UseCase.cxx index c172f9b39..398646110 100644 --- a/src/SALOMEDS/Test/SALOMEDSTest_UseCase.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_UseCase.cxx @@ -144,8 +144,6 @@ void SALOMEDSTest::testUseCase() it->Next(); CPPUNIT_ASSERT(it->More()); CPPUNIT_ASSERT(it->Value()->GetID() == so1->GetID()); - - study->Clear(); } #undef SALOMEDS_ALL_TESTS diff --git a/src/SALOMEDSClient/SALOMEDSClient_Study.hxx b/src/SALOMEDSClient/SALOMEDSClient_Study.hxx index 7a9c7ba4c..843460ed5 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_Study.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_Study.hxx @@ -49,7 +49,6 @@ class SALOMEDSClient_Study public: virtual ~SALOMEDSClient_Study() {} - virtual void Init() = 0; virtual void Clear() = 0; virtual bool Open(const std::string& theStudyUrl) = 0; diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx index 761ff0aa3..aa8349e28 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_Driver.hxx @@ -60,7 +60,7 @@ public: const std::string& theURL, bool isMultiFile) = 0; - virtual void Close(const SALOMEDSImpl_SComponent& theComponent) = 0; + virtual void Close() = 0; virtual std::string ComponentDataType() = 0; -- 2.39.2