/*! \brief Clear a study object
*/
- void Clear();
+ void Clear() raises(StudyInvalidReference);
/*! \brief Initialization a study object
*/
- void Init();
+ void Init() raises(StudyInvalidReference);
/*! \brief Open a study by url
Saves a study.
\param theMultiFile If this parameter is True the study will be saved in several files.
*/
- boolean Save(in boolean theMultiFile);
+ boolean Save(in boolean theMultiFile) raises(StudyInvalidReference);
/*! \brief Saving a study in a ASCII file (or files).
Saves a study in an ASCII format file (or files).
\param theMultiFile If this parameter is True the study will be saved in several files.
*/
- boolean SaveASCII(in boolean theMultiFile);
+ boolean SaveASCII(in boolean theMultiFile) raises(StudyInvalidReference);
/*! \brief Saving the study in a specified HDF file (or files).
Saves the study in a specified file (or files).
<em>See \ref example1 for an example of this method usage in batchmode of %SALOME application.</em>
*/
boolean SaveAs(in URLPath aUrl, // if the file already exists
- in boolean theMultiFile); // overwrite (as option)
+ in boolean theMultiFile) // overwrite (as option)
+ raises(StudyInvalidReference);
/*! \brief Saving the study in a specified ASCII file (or files).
Saves the study in a specified ASCII file (or files).
\param theMultiFile If this parameter is True the study will be saved in several files.
*/
boolean SaveAsASCII(in URLPath aUrl, // if the file already exists
- in boolean theMultiFile); // overwrite (as option)
-
+ in boolean theMultiFile) // overwrite (as option)
+ raises(StudyInvalidReference);
/*!
Returns True, if the given %SObject can be copied to the clipboard.
*/
- boolean CanCopy(in SObject theObject);
+ boolean CanCopy(in SObject theObject) raises(StudyInvalidReference);
/*!
Returns True, if the given %SObject is copied to the clipboard.
\param theObject The %SObject which will be copied
*/
- boolean Copy(in SObject theObject);
+ boolean Copy(in SObject theObject) raises(StudyInvalidReference);
/*!
Returns True, if the object from the clipboard can be pasted to the given %SObject.
\param theObject The %SObject stored in the clipboard.
*/
- boolean CanPaste(in SObject theObject);
+ boolean CanPaste(in SObject theObject) raises(StudyInvalidReference);
/*!
Returns the %SObject in which the object from the clipboard was pasted to.
\param theObject The %SObject which will be pasted
_orb = CORBA::ORB::_duplicate(orb);
_impl = new SALOMEDSImpl_Study();
_factory = new SALOMEDS_DriverFactory_i(_orb);
+ _closed = true;
Init();
}
if ( !_impl->GetDocument() )
_impl->Init();
+ if (!_closed)
+ throw SALOMEDS::Study::StudyInvalidReference();
+
_builder = new SALOMEDS_StudyBuilder_i(_impl->NewBuilder(), _orb);
_notifier = new SALOMEDS::Notifier(_orb);
_genObjRegister = new SALOMEDS::GenObjRegister(_orb);
//============================================================================
void SALOMEDS_Study_i::Clear()
{
+ SALOMEDS::Locker lock;
+ if (_closed)
+ throw SALOMEDS::Study::StudyInvalidReference();
//delete the builder servant
PortableServer::POA_var poa=_builder->_default_POA();
PortableServer::ObjectId_var anObjectId = poa->servant_to_id(_builder);
poa->deactivate_object(anObjectId.in());
_builder->_remove_ref();
- SALOMEDS::Locker lock;
-
- if (_closed)
- throw SALOMEDS::Study::StudyInvalidReference();
-
RemovePostponed(-1);
+
if (_impl->GetDocument()) {
SALOMEDS::SComponentIterator_var itcomponent = NewComponentIterator();
for (; itcomponent->More(); itcomponent->Next()) {
CORBA::Boolean SALOMEDS_Study_i::Save(CORBA::Boolean theMultiFile)
{
SALOMEDS::Locker lock;
+ if (_closed)
+ throw SALOMEDS::Study::StudyInvalidReference();
return _impl->Save(_factory, theMultiFile);
}
CORBA::Boolean SALOMEDS_Study_i::SaveASCII(CORBA::Boolean theMultiFile)
{
SALOMEDS::Locker lock;
+ if (_closed)
+ throw SALOMEDS::Study::StudyInvalidReference();
return _impl->SaveASCII(_factory, theMultiFile);
}
CORBA::Boolean SALOMEDS_Study_i::SaveAs(const char* aUrl, CORBA::Boolean theMultiFile)
{
SALOMEDS::Locker lock;
+ if (_closed)
+ throw SALOMEDS::Study::StudyInvalidReference();
return _impl->SaveAs(std::string(aUrl), _factory, theMultiFile);
}
CORBA::Boolean SALOMEDS_Study_i::SaveAsASCII(const char* aUrl, CORBA::Boolean theMultiFile)
{
SALOMEDS::Locker lock;
+ if (_closed)
+ throw SALOMEDS::Study::StudyInvalidReference();
return _impl->SaveAsASCII(std::string(aUrl), _factory, theMultiFile);
}
CORBA::Boolean SALOMEDS_Study_i::CanCopy(SALOMEDS::SObject_ptr theObject)
{
SALOMEDS::Locker lock;
+ if (_closed)
+ throw SALOMEDS::Study::StudyInvalidReference();
CORBA::String_var anID = theObject->GetID();
SALOMEDSImpl_SObject anObject = _impl->GetSObject(anID.in());
CORBA::Boolean SALOMEDS_Study_i::Copy(SALOMEDS::SObject_ptr theObject)
{
SALOMEDS::Locker lock;
+ if (_closed)
+ throw SALOMEDS::Study::StudyInvalidReference();
CORBA::String_var anID = theObject->GetID();
SALOMEDSImpl_SObject anObject = _impl->GetSObject(anID.in());
CORBA::Boolean SALOMEDS_Study_i::CanPaste(SALOMEDS::SObject_ptr theObject)
{
SALOMEDS::Locker lock;
+ if (_closed)
+ throw SALOMEDS::Study::StudyInvalidReference();
CORBA::String_var anID = theObject->GetID();
SALOMEDSImpl_SObject anObject = _impl->GetSObject(anID.in());