// Author : Sergey RUIN
// Module : SALOME
+
+#include "utilities.h"
+
#include "SALOMEDS_AttributeTarget.hxx"
#include "SALOMEDS.hxx"
void SALOMEDS_AttributeTarget::Add(const _PTR(SObject)& theObject)
{
+ ASSERT(theObject);
+ if(!theObject) return;
+
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
if (_isLocal) {
void SALOMEDS_AttributeTarget::Remove(const _PTR(SObject)& theObject)
{
+ ASSERT(theObject);
+ if(!theObject) return;
+
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theObject.get());
if (_isLocal) {
// Author : Sergey RUIN
// Module : SALOME
-
+#include "utilities.h"
#include "SALOMEDS_AttributeTarget_i.hxx"
#include "SALOMEDSImpl_SObject.hxx"
void SALOMEDS_AttributeTarget_i::Add(SALOMEDS::SObject_ptr anObject)
{
SALOMEDS::Locker lock;
+
+ ASSERT(!CORBA::is_nil(anObject));
+ if(CORBA::is_nil(anObject)) return;
+
TDF_Label aLabel;
TDF_Tool::Label(_impl->Label().Data(),anObject->GetID(),aLabel,1);
(Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_impl))->Add(SALOMEDSImpl_Study::SObject(aLabel));
void SALOMEDS_AttributeTarget_i::Remove(SALOMEDS::SObject_ptr anObject)
{
SALOMEDS::Locker lock;
+
+ ASSERT(!CORBA::is_nil(anObject));
+ if(CORBA::is_nil(anObject)) return;
+
TDF_Label aLabel;
TDF_Tool::Label(_impl->Label().Data(),anObject->GetID(),aLabel,1);
(Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_impl))->Remove(SALOMEDSImpl_Study::SObject(aLabel));
// Author : Sergey RUIN
// Module : SALOME
+#include "utilities.h"
+
#include "SALOMEDS_AttributeTreeNode.hxx"
#include "SALOMEDS.hxx"
void SALOMEDS_AttributeTreeNode::SetFather(const _PTR(AttributeTreeNode)& value)
{
+ ASSERT(value);
+ if(!value) return;
+
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
if (_isLocal) {
CheckLocked();
void SALOMEDS_AttributeTreeNode::SetPrevious(const _PTR(AttributeTreeNode)& value)
{
+ ASSERT(value);
+ if(!value) return;
+
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
if (_isLocal) {
CheckLocked();
void SALOMEDS_AttributeTreeNode::SetNext(const _PTR(AttributeTreeNode)& value)
{
+ ASSERT(value);
+ if(!value) return;
+
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
if (_isLocal) {
CheckLocked();
void SALOMEDS_AttributeTreeNode::SetFirst(const _PTR(AttributeTreeNode)& value)
{
+ ASSERT(value);
+ if(!value) return;
+
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
if (_isLocal) {
CheckLocked();
void SALOMEDS_AttributeTreeNode::Append(const _PTR(AttributeTreeNode)& value)
{
+ ASSERT(value);
+ if(!value) return;
+
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
if (_isLocal) {
CheckLocked();
void SALOMEDS_AttributeTreeNode::Prepend(const _PTR(AttributeTreeNode)& value)
{
+ ASSERT(value);
+ if(!value) return;
+
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
if (_isLocal) {
CheckLocked();
void SALOMEDS_AttributeTreeNode::InsertBefore(const _PTR(AttributeTreeNode)& value)
{
+ ASSERT(value);
+ if(!value) return;
+
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
if (_isLocal) {
CheckLocked();
void SALOMEDS_AttributeTreeNode::InsertAfter(const _PTR(AttributeTreeNode)& value)
{
+ ASSERT(value);
+ if(!value) return;
+
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
if (_isLocal) {
CheckLocked();
bool SALOMEDS_AttributeTreeNode::IsDescendant(const _PTR(AttributeTreeNode)& value)
{
+ if(!value) return false;
+
bool ret;
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
if (_isLocal) {
bool SALOMEDS_AttributeTreeNode::IsFather(const _PTR(AttributeTreeNode)& value)
{
+ if(!value) return false;
+
bool ret;
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
if (_isLocal) {
bool SALOMEDS_AttributeTreeNode::IsChild(const _PTR(AttributeTreeNode)& value)
{
+ if(!value) return false;
+
bool ret;
SALOMEDS_AttributeTreeNode* aTN = dynamic_cast<SALOMEDS_AttributeTreeNode*>(value.get());
if (_isLocal) {
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(value));
+ if(CORBA::is_nil(value)) return;
+
Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_impl);
aNode->SetFather(GetNode(value, aNode));
}
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(value));
+ if(CORBA::is_nil(value)) return;
+
Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_impl);
aNode->SetPrevious(GetNode(value, aNode));
}
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(value));
+ if(CORBA::is_nil(value)) return;
+
Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_impl);
aNode->SetNext(GetNode(value, aNode));
}
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(value));
+ if(CORBA::is_nil(value)) return;
+
Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_impl);
aNode->SetFirst(GetNode(value, aNode));
}
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(value));
+ if(CORBA::is_nil(value)) return;
+
Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_impl);
aNode->Append(GetNode(value, aNode));
}
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(value));
+ if(CORBA::is_nil(value)) return;
+
Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_impl);
aNode->Prepend(GetNode(value, aNode));
}
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(value));
+ if(CORBA::is_nil(value)) return;
+
Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_impl);
aNode->InsertBefore(GetNode(value, aNode));
}
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(value));
+ if(CORBA::is_nil(value)) return;
+
Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_impl);
aNode->InsertAfter(GetNode(value, aNode));
}
CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsDescendant(SALOMEDS::AttributeTreeNode_ptr value)
{
SALOMEDS::Locker lock;
+
+ if(CORBA::is_nil(value)) return false;
+
Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_impl);
return aNode->IsDescendant(GetNode(value, aNode));
}
CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsFather(SALOMEDS::AttributeTreeNode_ptr value)
{
SALOMEDS::Locker lock;
+
+ if(CORBA::is_nil(value)) return false;
+
Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_impl);
return aNode->IsFather(GetNode(value, aNode));
}
CORBA::Boolean SALOMEDS_AttributeTreeNode_i::IsChild(SALOMEDS::AttributeTreeNode_ptr value)
{
SALOMEDS::Locker lock;
+
+ if(CORBA::is_nil(value)) return false;
+
Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_impl);
return aNode->IsChild(GetNode(value, aNode));
}
{
SALOMEDS::Locker lock;
+ if(theGA.IsNull()) return NULL;
+
SALOMEDS_GenericAttribute* aGA = NULL;
std::string aTypeOfAttribute = theGA->GetClassType().ToCString();
__CreateGenericClientAttributeLocal
SALOMEDS_GenericAttribute* SALOMEDS_GenericAttribute::CreateAttribute(SALOMEDS::GenericAttribute_ptr theGA)
{
+ if(CORBA::is_nil(theGA)) return NULL;
+
SALOMEDS_GenericAttribute* aGA = NULL;
std::string aTypeOfAttribute = theGA->GetClassType();
__CreateGenericClientAttributeCORBA
_mapOfAttrib[theAttr.operator->()] = attr_servant;
}
*/
+ if(theAttr.IsNull()) return SALOMEDS::GenericAttribute::_nil();
+
// mpv: now servants Destroyed by common algos of CORBA
char* aTypeOfAttribute = Handle(SALOMEDSImpl_GenericAttribute)::
DownCast(theAttr)->GetClassType().ToCString();
_PTR(ChildIterator) SALOMEDS_Study::NewChildIterator(const _PTR(SObject)& theSO)
{
+
+ ASSERT(theSO);
+
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
SALOMEDSClient_ChildIterator* aCI = NULL;
+
+ if(!theSO) return _PTR(ChildIterator)(aCI);
+
if (_isLocal) {
SALOMEDS::Locker lock;
std::vector<_PTR(SObject)> SALOMEDS_Study::FindDependances(const _PTR(SObject)& theSO)
{
+ ASSERT(theSO);
std::vector<_PTR(SObject)> aVector;
+ if(!theSO) return aVector;
+
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
int aLength, i;
if (_isLocal) {
void SALOMEDS_StudyBuilder::DefineComponentInstance (const _PTR(SComponent)& theSCO,
const std::string& ComponentIOR)
{
- if(theSCO) return;
+ ASSERT(theSCO);
+ if(!theSCO) return;
SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
if (_isLocal) {
void SALOMEDS_StudyBuilder::RemoveComponent(const _PTR(SComponent)& theSCO)
{
+ ASSERT(theSCO);
if(!theSCO) return;
+
SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
if (_isLocal) {
CheckLocked();
{
CheckLocked();
+ ASSERT(theFatherObject);
+
SALOMEDSClient_SObject* aSO = NULL;
SALOMEDS_SObject* father = dynamic_cast< SALOMEDS_SObject*>(theFatherObject.get());
if (father == NULL) return _PTR(SObject)(aSO);
{
CheckLocked();
+ ASSERT(theFatherObject);
+ ASSERT(theTag > 0);
+
SALOMEDSClient_SObject* aSO = NULL;
SALOMEDS_SObject* father = dynamic_cast< SALOMEDS_SObject*>(theFatherObject.get());
if (father == NULL) return _PTR(SObject)(aSO);
void SALOMEDS_StudyBuilder::LoadWith(const _PTR(SComponent)& theSCO, const std::string& theIOR)
{
- if(!theSCO) return;
+ ASSERT(theSCO);
+ if(!theSCO)
+ THROW_SALOME_CORBA_EXCEPTION("Null SComponent", SALOME::BAD_PARAM);
SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
CORBA::Object_var obj = _orb->string_to_object(theIOR.c_str());
void SALOMEDS_StudyBuilder::Load(const _PTR(SObject)& theSCO)
{
+ ASSERT(theSCO);
+ if(!theSCO)
+ THROW_SALOME_CORBA_EXCEPTION("Null SComponent", SALOME::BAD_PARAM);
+
SALOMEDS_SComponent* aSCO = dynamic_cast<SALOMEDS_SComponent*>(theSCO.get());
if (_isLocal) _local_impl->Load(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl()));
else _corba_impl->Load(SALOMEDS::SComponent::_narrow(aSCO->GetCORBAImpl()));
void SALOMEDS_StudyBuilder::RemoveObject(const _PTR(SObject)& theSO)
{
+ ASSERT(theSO);
if(!theSO) return;
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
void SALOMEDS_StudyBuilder::RemoveObjectWithChildren(const _PTR(SObject)& theSO)
{
+ ASSERT(theSO);
if(!theSO) return;
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
_PTR(GenericAttribute) SALOMEDS_StudyBuilder::FindOrCreateAttribute(const _PTR(SObject)& theSO,
const std::string& aTypeOfAttribute)
{
+ ASSERT(theSO);
+
SALOMEDSClient_GenericAttribute* anAttr = NULL;
if(!theSO) return _PTR(GenericAttribute)(anAttr);
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
void SALOMEDS_StudyBuilder::RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute)
{
+ ASSERT(theSO);
if(!theSO) return;
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
void SALOMEDS_StudyBuilder::Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject)
{
+ ASSERT(me);
+ ASSERT(thereferencedObject);
if(!me || !thereferencedObject) return;
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(me.get());
void SALOMEDS_StudyBuilder::RemoveReference(const _PTR(SObject)& me)
{
+ ASSERT(me);
if(!me) return;
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(me.get());
if (_isLocal) {
void SALOMEDS_StudyBuilder::SetGUID(const _PTR(SObject)& theSO, const std::string& theGUID)
{
+ ASSERT(theSO);
if(!theSO) return;
if(!Standard_GUID::CheckGUIDFormat((char*)theGUID.c_str())) throw invalid_argument("Invalid GUID");
bool SALOMEDS_StudyBuilder::IsGUID(const _PTR(SObject)& theSO, const std::string& theGUID)
{
+ ASSERT(theSO);
if(!theSO || !Standard_GUID::CheckGUIDFormat((char*)theGUID.c_str())) return false;
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
void SALOMEDS_StudyBuilder::SetName(const _PTR(SObject)& theSO, const std::string& theValue)
{
+ ASSERT(theSO);
if(!theSO) return;
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
void SALOMEDS_StudyBuilder::SetComment(const _PTR(SObject)& theSO, const std::string& theValue)
{
+ ASSERT(theSO);
if(!theSO) return;
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
void SALOMEDS_StudyBuilder::SetIOR(const _PTR(SObject)& theSO, const std::string& theValue)
{
+ ASSERT(theSO);
if(!theSO) return;
SALOMEDS_SObject* aSO = dynamic_cast<SALOMEDS_SObject*>(theSO.get());
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(aComponent));
+ if(CORBA::is_nil(aComponent)) return;
+
Handle(SALOMEDSImpl_SComponent) aSCO;
aSCO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSComponent((char*)aComponent->GetID());
{
SALOMEDS::Locker lock;
CheckLocked();
+
ASSERT(!CORBA::is_nil(aComponent));
+ if(CORBA::is_nil(aComponent)) return;
+
Handle(SALOMEDSImpl_SComponent) aSCO;
aSCO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSComponent((char*)aComponent->GetID());
_impl->RemoveComponent(aSCO);
{
SALOMEDS::Locker lock;
CheckLocked();
-
+
+ ASSERT(!CORBA::is_nil(theFatherObject));
+ if(CORBA::is_nil(theFatherObject)) return SALOMEDS::SObject::_nil();
+
Handle(SALOMEDSImpl_SObject) aFO, aSO;
aFO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)theFatherObject->GetID());
aSO = _impl->NewObject(aFO);
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(theFatherObject));
+ if(CORBA::is_nil(theFatherObject)) return SALOMEDS::SObject::_nil();
+
Handle(SALOMEDSImpl_SObject) aFO, aSO;
aFO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)theFatherObject->GetID());
aSO = _impl->NewObjectToTag(aFO, atag);
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(anObject));
+ if(CORBA::is_nil(anObject)) return;
+
Handle(SALOMEDSImpl_SObject) aSO;
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)anObject->GetID());
_impl->RemoveObject(aSO);
{
SALOMEDS::Locker lock;
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(anObject));
+ if(CORBA::is_nil(anObject)) return;
+
Handle(SALOMEDSImpl_SObject) aSO;
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)anObject->GetID());
_impl->RemoveObjectWithChildren(aSO);
SALOMEDS::Locker lock;
Unexpect aCatch(SBSalomeException);
- Handle(SALOMEDSImpl_SComponent) aSCO;
- aSCO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSComponent((char*)anSCO->GetID());
- SALOMEDS_Driver_i* driver = new SALOMEDS_Driver_i(aDriver, _orb);
- bool isDone = _impl->LoadWith(aSCO, driver);
- delete driver;
+ ASSERT(!CORBA::is_nil(anSCO));
+
+ bool isDone = false;
+
+ if(!CORBA::is_nil(anSCO)) {
+
+ Handle(SALOMEDSImpl_SComponent) aSCO;
+ aSCO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSComponent((char*)anSCO->GetID());
+ SALOMEDS_Driver_i* driver = new SALOMEDS_Driver_i(aDriver, _orb);
+ isDone = _impl->LoadWith(aSCO, driver);
+ delete driver;
+
+ }
if(!isDone && _impl->IsError()) {
THROW_SALOME_CORBA_EXCEPTION(_impl->GetErrorCode().ToCString(),SALOME::BAD_PARAM);
const char* aTypeOfAttribute)
{
SALOMEDS::Locker lock;
+ ASSERT(!CORBA::is_nil(anObject));
+
+ if(CORBA::is_nil(anObject)) return SALOMEDS::GenericAttribute::_nil();
+
Handle(SALOMEDSImpl_SObject) aSO;
CORBA::String_var anID = anObject->GetID();
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject(anID.inout());
+
Handle(TDF_Attribute) anAttr;
try {
anAttr = _impl->FindOrCreateAttribute(aSO, TCollection_AsciiString((char*)aTypeOfAttribute));
const char* aTypeOfAttribute)
{
SALOMEDS::Locker lock;
+
ASSERT(!CORBA::is_nil(anObject));
+ if(CORBA::is_nil(anObject)) return false;
+
Handle(SALOMEDSImpl_SObject) aSO;
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)anObject->GetID());
Handle(TDF_Attribute) anAttr;
{
SALOMEDS::Locker lock;
CheckLocked();
+
ASSERT(!CORBA::is_nil(anObject));
+ if(CORBA::is_nil(anObject)) return;
+
Handle(SALOMEDSImpl_SObject) aSO;
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)anObject->GetID());
_impl->RemoveAttribute(aSO, TCollection_AsciiString((char*)aTypeOfAttribute));
{
SALOMEDS::Locker lock;
CheckLocked();
+
ASSERT(!CORBA::is_nil(me));
ASSERT(!CORBA::is_nil(theReferencedObject));
-
+ if(CORBA::is_nil(me) || CORBA::is_nil(theReferencedObject)) return;
+
Handle(SALOMEDSImpl_SObject) aSO, aRefSO;
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)me->GetID());
aRefSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)theReferencedObject->GetID());
{
SALOMEDS::Locker lock;
CheckLocked();
+
ASSERT(!CORBA::is_nil(me));
+ if(CORBA::is_nil(me)) return;
+
Handle(SALOMEDSImpl_SObject) aSO;
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)me->GetID());
_impl->RemoveReference(aSO);
{
SALOMEDS::Locker lock;
CheckLocked();
+
ASSERT(!CORBA::is_nil(anObject));
+ if(CORBA::is_nil(anObject)) return;
+
Handle(SALOMEDSImpl_SObject) aSO;
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)anObject->GetID());
_impl->SetGUID(aSO, TCollection_AsciiString((char*)theGUID));
bool SALOMEDS_StudyBuilder_i::IsGUID(SALOMEDS::SObject_ptr anObject, const char* theGUID)
{
SALOMEDS::Locker lock;
+
ASSERT(!CORBA::is_nil(anObject));
+ if(CORBA::is_nil(anObject)) return false;
+
Handle(SALOMEDSImpl_SObject) aSO;
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)anObject->GetID());
return _impl->IsGUID(aSO, TCollection_AsciiString((char*)theGUID));
SALOMEDS::Locker lock;
Unexpect aCatch(SBLockProtection);
CheckLocked();
+
+ ASSERT(!CORBA::is_nil(theSO));
+ if(CORBA::is_nil(theSO)) return;
Handle(SALOMEDSImpl_SObject) aSO;
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)theSO->GetID());
Unexpect aCatch(SBLockProtection);
CheckLocked();
+ ASSERT(!CORBA::is_nil(theSO));
+ if(CORBA::is_nil(theSO)) return;
+
Handle(SALOMEDSImpl_SObject) aSO;
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)theSO->GetID());
_impl->SetComment(aSO, TCollection_AsciiString((char*)theValue));
Unexpect aCatch(SBLockProtection);
CheckLocked();
+ ASSERT(!CORBA::is_nil(theSO));
+ if(CORBA::is_nil(theSO)) return;
+
Handle(SALOMEDSImpl_SObject) aSO;
aSO = Handle(SALOMEDSImpl_Study)::DownCast(_impl->GetOwner())->GetSObject((char*)theSO->GetID());
_impl->SetIOR(aSO, TCollection_AsciiString((char*)theValue));
{
SALOMEDS::Locker lock;
+ if(CORBA::is_nil(theObject)) return false;
+
SALOMEDS::Study_var aStudy = theObject->GetStudy();
Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
Handle(SALOMEDSImpl_SObject) anObject = aStudyImpl->GetSObject((char*)theObject->GetID());
{
SALOMEDS::Locker lock;
+ if(CORBA::is_nil(theObject)) return false;
+
SALOMEDS::Study_var aStudy = theObject->GetStudy();
Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
Handle(SALOMEDSImpl_SObject) anObject = aStudyImpl->GetSObject((char*)theObject->GetID());
{
SALOMEDS::Locker lock;
+ if(CORBA::is_nil(theObject)) return false;
+
SALOMEDS::Study_var aStudy = theObject->GetStudy();
Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
Handle(SALOMEDSImpl_SObject) anObject = aStudyImpl->GetSObject((char*)theObject->GetID());
SALOMEDS::Locker lock;
Unexpect aCatch(LockProtection);
+
+ if(CORBA::is_nil(theObject)) return SALOMEDS::SObject::_nil();
+
SALOMEDS::Study_var aStudy = theObject->GetStudy();
Handle(SALOMEDSImpl_Study) aStudyImpl = _impl->GetStudyByID(aStudy->StudyId());
SALOMEDS_Driver_i* GetDriver(const Handle(SALOMEDSImpl_SObject)& theObject, CORBA::ORB_ptr orb)
{
SALOMEDS_Driver_i* driver = NULL;
+
+ if(theObject.IsNull()) return driver;
Handle(SALOMEDSImpl_SComponent) aSCO = theObject->GetFatherComponent();
if(!aSCO.IsNull()) {
{
SALOMEDS::Locker lock;
+ ASSERT(!CORBA::is_nil(theSO));
+ if(CORBA::is_nil(theSO)) return SALOMEDS::ChildIterator::_nil();
+
Handle(SALOMEDSImpl_SObject) aSO = _impl->GetSObject(theSO->GetID());
Handle(SALOMEDSImpl_ChildIterator) anItr = new SALOMEDSImpl_ChildIterator(aSO);
{
SALOMEDS::Locker lock;
+ ASSERT(!theLabel.IsNull());
+ if(theLabel.IsNull()) return SALOMEDS::Study::_nil();
+
Handle(SALOMEDSImpl_AttributeIOR) Att;
if (theLabel.Root().FindAttribute(SALOMEDSImpl_AttributeIOR::GetID(),Att)){
char* IOR = CORBA::string_dup(TCollection_AsciiString(Att->Value()).ToCString());
{
SALOMEDS::Locker lock;
- SALOMEDS::GenericAttribute_ptr aTarget;
- if (anObject->FindAttribute(aTarget,"AttributeTarget")) {
- return SALOMEDS::AttributeTarget::_narrow(aTarget)->Get();
+ ASSERT(!CORBA::is_nil(anObject));
+ if(!CORBA::is_nil(anObject)) {
+ SALOMEDS::GenericAttribute_ptr aTarget;
+ if (anObject->FindAttribute(aTarget,"AttributeTarget")) {
+ return SALOMEDS::AttributeTarget::_narrow(aTarget)->Get();
+ }
}
+
SALOMEDS::Study::ListOfSObject* aList = new SALOMEDS::Study::ListOfSObject;
aList->length(0);
return aList;