From 6e9352e8ba00433ee68b19a2fe134cd31073cdc9 Mon Sep 17 00:00:00 2001 From: srn Date: Thu, 12 May 2005 05:23:41 +0000 Subject: [PATCH] Added support of BOOST's shared_ptr --- src/SALOMEDS/Makefile.in | 4 +- src/SALOMEDS/SALOMEDS_AttributeTarget.cxx | 18 +-- src/SALOMEDS/SALOMEDS_AttributeTarget.hxx | 10 +- src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx | 68 ++++----- src/SALOMEDS/SALOMEDS_AttributeTreeNode.hxx | 30 ++-- src/SALOMEDS/SALOMEDS_ChildIterator.cxx | 6 +- src/SALOMEDS/SALOMEDS_ChildIterator.hxx | 5 +- src/SALOMEDS/SALOMEDS_GenericAttribute.cxx | 4 +- src/SALOMEDS/SALOMEDS_GenericAttribute.hxx | 5 +- src/SALOMEDS/SALOMEDS_SComponentIterator.cxx | 6 +- src/SALOMEDS/SALOMEDS_SComponentIterator.hxx | 5 +- src/SALOMEDS/SALOMEDS_SObject.cxx | 50 +++---- src/SALOMEDS/SALOMEDS_SObject.hxx | 18 ++- src/SALOMEDS/SALOMEDS_Study.cxx | 135 +++++++++--------- src/SALOMEDS/SALOMEDS_Study.hxx | 40 +++--- src/SALOMEDS/SALOMEDS_StudyBuilder.cxx | 117 ++++++++------- src/SALOMEDS/SALOMEDS_StudyBuilder.hxx | 47 +++--- src/SALOMEDS/SALOMEDS_StudyManager.cxx | 72 +++++----- src/SALOMEDS/SALOMEDS_StudyManager.hxx | 29 ++-- src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx | 46 +++--- src/SALOMEDS/SALOMEDS_UseCaseBuilder.hxx | 24 ++-- src/SALOMEDS/SALOMEDS_UseCaseIterator.cxx | 4 +- src/SALOMEDS/SALOMEDS_UseCaseIterator.hxx | 2 +- src/SALOMEDSClient/SALOMEDSClient.hxx | 2 +- .../SALOMEDSClient_AttributeComment.hxx | 1 + .../SALOMEDSClient_AttributeDrawable.hxx | 1 + .../SALOMEDSClient_AttributeExpandable.hxx | 1 + ...ALOMEDSClient_AttributeExternalFileDef.hxx | 1 + .../SALOMEDSClient_AttributeFileType.hxx | 1 + .../SALOMEDSClient_AttributeFlags.hxx | 1 + .../SALOMEDSClient_AttributeGraphic.hxx | 1 + .../SALOMEDSClient_AttributeIOR.hxx | 1 + .../SALOMEDSClient_AttributeInteger.hxx | 1 + .../SALOMEDSClient_AttributeLocalID.hxx | 1 + .../SALOMEDSClient_AttributeName.hxx | 1 + .../SALOMEDSClient_AttributeOpened.hxx | 1 + .../SALOMEDSClient_AttributePersistentRef.hxx | 1 + .../SALOMEDSClient_AttributePixMap.hxx | 1 + .../SALOMEDSClient_AttributePythonObject.hxx | 1 + .../SALOMEDSClient_AttributeReal.hxx | 1 + .../SALOMEDSClient_AttributeSelectable.hxx | 1 + ...OMEDSClient_AttributeSequenceOfInteger.hxx | 1 + ...SALOMEDSClient_AttributeSequenceOfReal.hxx | 1 + ...ALOMEDSClient_AttributeStudyProperties.hxx | 2 +- ...SALOMEDSClient_AttributeTableOfInteger.hxx | 1 + .../SALOMEDSClient_AttributeTableOfReal.hxx | 1 + .../SALOMEDSClient_AttributeTableOfString.hxx | 1 + .../SALOMEDSClient_AttributeTarget.hxx | 7 +- .../SALOMEDSClient_AttributeTextColor.hxx | 1 + ...MEDSClient_AttributeTextHighlightColor.hxx | 1 + .../SALOMEDSClient_AttributeTreeNode.hxx | 31 ++-- .../SALOMEDSClient_AttributeUserID.hxx | 1 + .../SALOMEDSClient_ChildIterator.hxx | 3 +- .../SALOMEDSClient_GenericAttribute.hxx | 4 +- .../SALOMEDSClient_SComponent.hxx | 1 + .../SALOMEDSClient_SComponentIterator.hxx | 4 +- src/SALOMEDSClient/SALOMEDSClient_SObject.hxx | 17 ++- src/SALOMEDSClient/SALOMEDSClient_Study.hxx | 33 +++-- .../SALOMEDSClient_StudyBuilder.hxx | 42 +++--- .../SALOMEDSClient_StudyManager.hxx | 27 ++-- .../SALOMEDSClient_UseCaseBuilder.hxx | 25 ++-- .../SALOMEDSClient_UseCaseIterator.hxx | 4 +- .../SALOMEDSClient_definitions.hxx | 41 +++++- 63 files changed, 540 insertions(+), 473 deletions(-) diff --git a/src/SALOMEDS/Makefile.in b/src/SALOMEDS/Makefile.in index 4e739bd99..5b82a2577 100644 --- a/src/SALOMEDS/Makefile.in +++ b/src/SALOMEDS/Makefile.in @@ -115,8 +115,8 @@ LIB_SERVER_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Exception.idl SALOM BIN_SERVER_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl BIN_CLIENT_IDL = -CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES) -CXXFLAGS+=$(OCC_CXXFLAGS) +CPPFLAGS+=$(OCC_INCLUDES) $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) +CXXFLAGS+=$(OCC_CXXFLAGS) $(BOOST_CPPFLAGS) LDFLAGS+= $(HDF5_LIBS) -lTOOLSDS -lSalomeNS -lSalomeHDFPersist -lOpUtil -lSALOMELocalTrace -lSalomeDSImpl -lSalomeGenericObj $(CAS_LDPATH) -lTKCAF -lTKBO -lTKStdSchema -lSalomeGenericObj -lSalomeLifeCycleCORBA # _CS_gbo_090604 Ajout Spécifique Calibre 3, pour l'utilisation de la version 5.12 de la bibliothèque OCC. diff --git a/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx b/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx index 1d5b15205..e47608f3c 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTarget.cxx @@ -21,41 +21,41 @@ SALOMEDS_AttributeTarget::SALOMEDS_AttributeTarget(SALOMEDS::AttributeTarget_ptr SALOMEDS_AttributeTarget::~SALOMEDS_AttributeTarget() {} -void SALOMEDS_AttributeTarget::Add(SALOMEDSClient_SObject* theObject) +void SALOMEDS_AttributeTarget::Add(const _PTR(SObject)& theObject) { - SALOMEDS_SObject* aSO = dynamic_cast(theObject); + SALOMEDS_SObject* aSO = dynamic_cast(theObject.get()); if(_isLocal) Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_local_impl)->Add(aSO->GetLocalImpl()); else SALOMEDS::AttributeTarget::_narrow(_corba_impl)->Add(aSO->GetCORBAImpl()); } -std::vector SALOMEDS_AttributeTarget::Get() +std::vector<_PTR(SObject)> SALOMEDS_AttributeTarget::Get() { - std::vector aVector; + std::vector<_PTR(SObject)> aVector; int aLength, i; - SALOMEDS_SObject* aSO = NULL; + SALOMEDSClient_SObject* aSO = NULL; if(_isLocal) { Handle(TColStd_HSequenceOfTransient) aSeq = Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_local_impl)->Get(); aLength = aSeq->Length(); for(i=1; i<=aLength; i++) { aSO = new SALOMEDS_SObject(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i))); - aVector.push_back(aSO); + aVector.push_back(_PTR(SObject)(aSO)); } } else { SALOMEDS::Study::ListOfSObject_var aSeq = SALOMEDS::AttributeTarget::_narrow(_corba_impl)->Get(); aLength = aSeq->length(); aSO = new SALOMEDS_SObject(aSeq[i].in()); - for(i = 0; i(theObject); + SALOMEDS_SObject* aSO = dynamic_cast(theObject.get()); if(_isLocal) Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_local_impl)->Remove(aSO->GetLocalImpl()); else SALOMEDS::AttributeTarget::_narrow(_corba_impl)->Remove(aSO->GetCORBAImpl()); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTarget.hxx b/src/SALOMEDS/SALOMEDS_AttributeTarget.hxx index 789977e25..d9a80b982 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTarget.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTarget.hxx @@ -7,9 +7,7 @@ #include -#include "SALOMEDSClient_SObject.hxx" - -#include "SALOMEDSClient_AttributeTarget.hxx" +#include "SALOMEDSClient.hxx" #include "SALOMEDS_GenericAttribute.hxx" #include "SALOMEDSImpl_AttributeTarget.hxx" @@ -25,9 +23,9 @@ public: SALOMEDS_AttributeTarget(SALOMEDS::AttributeTarget_ptr theAttr); ~SALOMEDS_AttributeTarget(); - virtual void Add(SALOMEDSClient_SObject* theObject); - virtual std::vector Get(); - virtual void Remove(SALOMEDSClient_SObject* theObject); + virtual void Add(const _PTR(SObject)& theObject); + virtual std::vector<_PTR(SObject)> Get(); + virtual void Remove(const _PTR(SObject)& theObject); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx index 7fb7a79dc..93b66d5ed 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.cxx @@ -25,9 +25,9 @@ SALOMEDS_AttributeTreeNode::SALOMEDS_AttributeTreeNode(SALOMEDS::AttributeTreeNo SALOMEDS_AttributeTreeNode::~SALOMEDS_AttributeTreeNode() {} -void SALOMEDS_AttributeTreeNode::SetFather(SALOMEDSClient_AttributeTreeNode* value) +void SALOMEDS_AttributeTreeNode::SetFather(const _PTR(AttributeTreeNode)& value) { - SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value); + SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value.get()); if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode, aFather; aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); @@ -55,9 +55,9 @@ bool SALOMEDS_AttributeTreeNode::HasFather() return ret; } -SALOMEDSClient_AttributeTreeNode* SALOMEDS_AttributeTreeNode::GetFather() +_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetFather() { - SALOMEDS_AttributeTreeNode* aTN; + SALOMEDSClient_AttributeTreeNode* aTN = NULL; if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); aTN = new SALOMEDS_AttributeTreeNode(aNode->GetFather()); @@ -66,12 +66,12 @@ SALOMEDSClient_AttributeTreeNode* SALOMEDS_AttributeTreeNode::GetFather() SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl); aTN = new SALOMEDS_AttributeTreeNode(aNode->GetFather()); } - return aTN; + return _PTR(AttributeTreeNode)(aTN); } -void SALOMEDS_AttributeTreeNode::SetPrevious(SALOMEDSClient_AttributeTreeNode* value) +void SALOMEDS_AttributeTreeNode::SetPrevious(const _PTR(AttributeTreeNode)& value) { - SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value); + SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value.get()); if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode, aPrev; aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); @@ -99,9 +99,9 @@ bool SALOMEDS_AttributeTreeNode::HasPrevious() return ret; } -SALOMEDSClient_AttributeTreeNode* SALOMEDS_AttributeTreeNode::GetPrevious() +_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetPrevious() { - SALOMEDS_AttributeTreeNode* aTN; + SALOMEDSClient_AttributeTreeNode* aTN = NULL; if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); aTN = new SALOMEDS_AttributeTreeNode(aNode->GetPrevious()); @@ -110,12 +110,12 @@ SALOMEDSClient_AttributeTreeNode* SALOMEDS_AttributeTreeNode::GetPrevious() SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl); aTN = new SALOMEDS_AttributeTreeNode(aNode->GetPrevious()); } - return aTN; + return _PTR(AttributeTreeNode)(aTN); } -void SALOMEDS_AttributeTreeNode::SetNext(SALOMEDSClient_AttributeTreeNode* value) +void SALOMEDS_AttributeTreeNode::SetNext(const _PTR(AttributeTreeNode)& value) { - SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value); + SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value.get()); if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode, aNext; aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); @@ -143,9 +143,9 @@ bool SALOMEDS_AttributeTreeNode::HasNext() return ret; } -SALOMEDSClient_AttributeTreeNode* SALOMEDS_AttributeTreeNode::GetNext() +_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetNext() { - SALOMEDS_AttributeTreeNode* aTN; + SALOMEDSClient_AttributeTreeNode* aTN = NULL; if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); aTN = new SALOMEDS_AttributeTreeNode(aNode->GetNext()); @@ -154,12 +154,12 @@ SALOMEDSClient_AttributeTreeNode* SALOMEDS_AttributeTreeNode::GetNext() SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl); aTN = new SALOMEDS_AttributeTreeNode(aNode->GetNext()); } - return aTN; + return _PTR(AttributeTreeNode)(aTN); } -void SALOMEDS_AttributeTreeNode::SetFirst(SALOMEDSClient_AttributeTreeNode* value) +void SALOMEDS_AttributeTreeNode::SetFirst(const _PTR(AttributeTreeNode)& value) { - SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value); + SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value.get()); if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode, aFirst; aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); @@ -187,9 +187,9 @@ bool SALOMEDS_AttributeTreeNode::HasFirst() return ret; } -SALOMEDSClient_AttributeTreeNode* SALOMEDS_AttributeTreeNode::GetFirst() +_PTR(AttributeTreeNode) SALOMEDS_AttributeTreeNode::GetFirst() { - SALOMEDS_AttributeTreeNode* aTN; + SALOMEDSClient_AttributeTreeNode* aTN = NULL; if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); aTN = new SALOMEDS_AttributeTreeNode(aNode->GetFirst()); @@ -198,7 +198,7 @@ SALOMEDSClient_AttributeTreeNode* SALOMEDS_AttributeTreeNode::GetFirst() SALOMEDS::AttributeTreeNode_var aNode = SALOMEDS::AttributeTreeNode::_narrow(_corba_impl); aTN = new SALOMEDS_AttributeTreeNode(aNode->GetFirst()); } - return aTN; + return _PTR(AttributeTreeNode)(aTN); } void SALOMEDS_AttributeTreeNode::SetTreeID(const std::string& value) @@ -230,9 +230,9 @@ std::string SALOMEDS_AttributeTreeNode::GetTreeID() return std::string(aGUID.ToCString()); } -void SALOMEDS_AttributeTreeNode::Append(SALOMEDSClient_AttributeTreeNode* value) +void SALOMEDS_AttributeTreeNode::Append(const _PTR(AttributeTreeNode)& value) { - SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value); + SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value.get()); if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther; aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); @@ -246,9 +246,9 @@ void SALOMEDS_AttributeTreeNode::Append(SALOMEDSClient_AttributeTreeNode* value) } } -void SALOMEDS_AttributeTreeNode::Prepend(SALOMEDSClient_AttributeTreeNode* value) +void SALOMEDS_AttributeTreeNode::Prepend(const _PTR(AttributeTreeNode)& value) { - SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value); + SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value.get()); if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther; aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); @@ -262,9 +262,9 @@ void SALOMEDS_AttributeTreeNode::Prepend(SALOMEDSClient_AttributeTreeNode* value } } -void SALOMEDS_AttributeTreeNode::InsertBefore(SALOMEDSClient_AttributeTreeNode* value) +void SALOMEDS_AttributeTreeNode::InsertBefore(const _PTR(AttributeTreeNode)& value) { - SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value); + SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value.get()); if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther; aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); @@ -278,9 +278,9 @@ void SALOMEDS_AttributeTreeNode::InsertBefore(SALOMEDSClient_AttributeTreeNode* } } -void SALOMEDS_AttributeTreeNode::InsertAfter(SALOMEDSClient_AttributeTreeNode* value) +void SALOMEDS_AttributeTreeNode::InsertAfter(const _PTR(AttributeTreeNode)& value) { - SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value); + SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value.get()); if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther; aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); @@ -316,10 +316,10 @@ bool SALOMEDS_AttributeTreeNode::IsRoot() return ret; } -bool SALOMEDS_AttributeTreeNode::IsDescendant(SALOMEDSClient_AttributeTreeNode* value) +bool SALOMEDS_AttributeTreeNode::IsDescendant(const _PTR(AttributeTreeNode)& value) { bool ret; - SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value); + SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value.get()); if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther; aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); @@ -334,10 +334,10 @@ bool SALOMEDS_AttributeTreeNode::IsDescendant(SALOMEDSClient_AttributeTreeNode* return ret; } -bool SALOMEDS_AttributeTreeNode::IsFather(SALOMEDSClient_AttributeTreeNode* value) +bool SALOMEDS_AttributeTreeNode::IsFather(const _PTR(AttributeTreeNode)& value) { bool ret; - SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value); + SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value.get()); if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther; aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); @@ -352,10 +352,10 @@ bool SALOMEDS_AttributeTreeNode::IsFather(SALOMEDSClient_AttributeTreeNode* valu return ret; } -bool SALOMEDS_AttributeTreeNode::IsChild(SALOMEDSClient_AttributeTreeNode* value) +bool SALOMEDS_AttributeTreeNode::IsChild(const _PTR(AttributeTreeNode)& value) { bool ret; - SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value); + SALOMEDS_AttributeTreeNode* aTN = dynamic_cast(value.get()); if(_isLocal) { Handle(SALOMEDSImpl_AttributeTreeNode) aNode, anOther; aNode = Handle(SALOMEDSImpl_AttributeTreeNode)::DownCast(_local_impl); diff --git a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.hxx b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.hxx index 6e3eca45b..bbb82abb9 100644 --- a/src/SALOMEDS/SALOMEDS_AttributeTreeNode.hxx +++ b/src/SALOMEDS/SALOMEDS_AttributeTreeNode.hxx @@ -21,30 +21,30 @@ public: SALOMEDS_AttributeTreeNode(SALOMEDS::AttributeTreeNode_ptr theAttr); ~SALOMEDS_AttributeTreeNode(); - virtual void SetFather(SALOMEDSClient_AttributeTreeNode* value); + virtual void SetFather(const _PTR(AttributeTreeNode)& value); virtual bool HasFather(); - virtual SALOMEDSClient_AttributeTreeNode* GetFather(); - virtual void SetPrevious(SALOMEDSClient_AttributeTreeNode* value); + virtual _PTR(AttributeTreeNode) GetFather(); + virtual void SetPrevious(const _PTR(AttributeTreeNode)& value); virtual bool HasPrevious(); - virtual SALOMEDSClient_AttributeTreeNode* GetPrevious(); - virtual void SetNext(SALOMEDSClient_AttributeTreeNode* value); + virtual _PTR(AttributeTreeNode) GetPrevious(); + virtual void SetNext(const _PTR(AttributeTreeNode)& value); virtual bool HasNext(); - virtual SALOMEDSClient_AttributeTreeNode* GetNext(); - virtual void SetFirst(SALOMEDSClient_AttributeTreeNode* value); + virtual _PTR(AttributeTreeNode) GetNext(); + virtual void SetFirst(const _PTR(AttributeTreeNode)& value); virtual bool HasFirst(); - virtual SALOMEDSClient_AttributeTreeNode* GetFirst(); + virtual _PTR(AttributeTreeNode) GetFirst(); virtual void SetTreeID(const std::string& value); virtual std::string GetTreeID(); - virtual void Append(SALOMEDSClient_AttributeTreeNode* value); - virtual void Prepend(SALOMEDSClient_AttributeTreeNode* value); - virtual void InsertBefore(SALOMEDSClient_AttributeTreeNode* value); - virtual void InsertAfter(SALOMEDSClient_AttributeTreeNode* value); + virtual void Append(const _PTR(AttributeTreeNode)& value); + virtual void Prepend(const _PTR(AttributeTreeNode)& value); + virtual void InsertBefore(const _PTR(AttributeTreeNode)& value); + virtual void InsertAfter(const _PTR(AttributeTreeNode)& value); virtual void Remove(); virtual int Depth(); virtual bool IsRoot(); - virtual bool IsDescendant(SALOMEDSClient_AttributeTreeNode* value); - virtual bool IsFather(SALOMEDSClient_AttributeTreeNode* value); - virtual bool IsChild(SALOMEDSClient_AttributeTreeNode* value); + virtual bool IsDescendant(const _PTR(AttributeTreeNode)& value); + virtual bool IsFather(const _PTR(AttributeTreeNode)& value); + virtual bool IsChild(const _PTR(AttributeTreeNode)& value); virtual std::string Label(); }; diff --git a/src/SALOMEDS/SALOMEDS_ChildIterator.cxx b/src/SALOMEDS/SALOMEDS_ChildIterator.cxx index 3bbaae065..78d9e3e99 100644 --- a/src/SALOMEDS/SALOMEDS_ChildIterator.cxx +++ b/src/SALOMEDS/SALOMEDS_ChildIterator.cxx @@ -52,10 +52,10 @@ void SALOMEDS_ChildIterator::Next() else _corba_impl->Next(); } -SALOMEDSClient_SObject* SALOMEDS_ChildIterator::Value() +_PTR(SObject) SALOMEDS_ChildIterator::Value() { - SALOMEDS_SObject* aSO; + SALOMEDSClient_SObject* aSO; if(_isLocal) aSO = new SALOMEDS_SObject(_local_impl->Value()); else aSO = new SALOMEDS_SObject(_corba_impl->Value()); - return aSO; + return _PTR(SObject)(aSO); } diff --git a/src/SALOMEDS/SALOMEDS_ChildIterator.hxx b/src/SALOMEDS/SALOMEDS_ChildIterator.hxx index 4bc6298a2..127611f9b 100644 --- a/src/SALOMEDS/SALOMEDS_ChildIterator.hxx +++ b/src/SALOMEDS/SALOMEDS_ChildIterator.hxx @@ -5,8 +5,7 @@ #ifndef __SALOMEDS_CHILDITERATOR_H__ #define __SALOMEDS_CHILDITERATOR_H__ -#include "SALOMEDSClient_ChildIterator.hxx" -#include "SALOMEDSClient_SObject.hxx" +#include "SALOMEDSClient.hxx" #include "SALOMEDSImpl_ChildIterator.hxx" // IDL headers @@ -30,6 +29,6 @@ public: virtual void InitEx(bool theAllLevels); virtual bool More(); virtual void Next(); - virtual SALOMEDSClient_SObject* Value(); + virtual _PTR(SObject) Value(); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx b/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx index c9d316bff..2bf6755fb 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute.cxx @@ -93,7 +93,7 @@ std::string SALOMEDS_GenericAttribute::GetClassType() return aType; } -SALOMEDSClient_SObject* SALOMEDS_GenericAttribute::GetSObject() +_PTR(SObject) SALOMEDS_GenericAttribute::GetSObject() { SALOMEDSClient_SObject* aSO = NULL; if(_isLocal) { @@ -103,7 +103,7 @@ SALOMEDSClient_SObject* SALOMEDS_GenericAttribute::GetSObject() aSO = new SALOMEDS_SObject(_corba_impl->GetSObject()); } - return aSO; + return _PTR(SObject)(aSO); } diff --git a/src/SALOMEDS/SALOMEDS_GenericAttribute.hxx b/src/SALOMEDS/SALOMEDS_GenericAttribute.hxx index e47218fc3..1ff7a2519 100644 --- a/src/SALOMEDS/SALOMEDS_GenericAttribute.hxx +++ b/src/SALOMEDS/SALOMEDS_GenericAttribute.hxx @@ -6,8 +6,7 @@ #define _GENERIC_ATTRIBUTE_HXX_ #include -#include "SALOMEDSClient_GenericAttribute.hxx" -#include "SALOMEDSClient_SObject.hxx" +#include "SALOMEDSClient.hxx" #include "SALOMEDSImpl_GenericAttribute.hxx" // IDL headers @@ -30,7 +29,7 @@ public: void CheckLocked(); std::string Type(); std::string GetClassType(); - SALOMEDSClient_SObject* GetSObject(); + _PTR(SObject) GetSObject(); static SALOMEDS_GenericAttribute* CreateAttribute(const Handle(SALOMEDSImpl_GenericAttribute)& theGA); static SALOMEDS_GenericAttribute* CreateAttribute(SALOMEDS::GenericAttribute_ptr theGA); diff --git a/src/SALOMEDS/SALOMEDS_SComponentIterator.cxx b/src/SALOMEDS/SALOMEDS_SComponentIterator.cxx index 35fb46d33..64c64abf8 100644 --- a/src/SALOMEDS/SALOMEDS_SComponentIterator.cxx +++ b/src/SALOMEDS/SALOMEDS_SComponentIterator.cxx @@ -44,10 +44,10 @@ void SALOMEDS_SComponentIterator::Next() else _corba_impl->Next(); } -SALOMEDSClient_SComponent* SALOMEDS_SComponentIterator::Value() +_PTR(SComponent) SALOMEDS_SComponentIterator::Value() { - SALOMEDS_SComponent* aSCO = NULL; + SALOMEDSClient_SComponent* aSCO = NULL; if(_isLocal) aSCO = new SALOMEDS_SComponent(_local_impl.Value()); else aSCO = new SALOMEDS_SComponent(_corba_impl->Value()); - return aSCO; + return _PTR(SComponent)(aSCO); } diff --git a/src/SALOMEDS/SALOMEDS_SComponentIterator.hxx b/src/SALOMEDS/SALOMEDS_SComponentIterator.hxx index 0bb2b3077..5d6495ac4 100644 --- a/src/SALOMEDS/SALOMEDS_SComponentIterator.hxx +++ b/src/SALOMEDS/SALOMEDS_SComponentIterator.hxx @@ -5,8 +5,7 @@ #ifndef __SALOMEDS_SCOMPONENTITERATOR_H__ #define __SALOMEDS_SCOMPONENTITERATOR_H__ -#include "SALOMEDSClient_SComponentIterator.hxx" -#include "SALOMEDSClient_SComponent.hxx" +#include "SALOMEDSClient.hxx" #include "SALOMEDSImpl_SComponentIterator.hxx" // IDL headers @@ -29,6 +28,6 @@ public: virtual void Init(); virtual bool More(); virtual void Next(); - virtual SALOMEDSClient_SComponent* Value(); + virtual _PTR(SComponent) Value(); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_SObject.cxx b/src/SALOMEDS/SALOMEDS_SObject.cxx index 4031fc027..ad8947241 100644 --- a/src/SALOMEDS/SALOMEDS_SObject.cxx +++ b/src/SALOMEDS/SALOMEDS_SObject.cxx @@ -73,75 +73,77 @@ std::string SALOMEDS_SObject::GetID() return aValue; } -SALOMEDSClient_SComponent* SALOMEDS_SObject::GetFatherComponent() +_PTR(SComponent) SALOMEDS_SObject::GetFatherComponent() { - if(_isLocal) - return new SALOMEDS_SComponent(Handle(SALOMEDSImpl_SComponent)::DownCast(_local_impl->GetFatherComponent())); - return new SALOMEDS_SComponent(_corba_impl->GetFatherComponent()); + if(_isLocal) { + Handle(SALOMEDSImpl_SComponent) aSCO = Handle(SALOMEDSImpl_SComponent)::DownCast(_local_impl->GetFatherComponent()); + return _PTR(SComponent)(new SALOMEDS_SComponent(aSCO)); + } + return _PTR(SComponent)(new SALOMEDS_SComponent(_corba_impl->GetFatherComponent())); } -SALOMEDSClient_SObject* SALOMEDS_SObject::GetFather() +_PTR(SObject) SALOMEDS_SObject::GetFather() { - if(_isLocal) return new SALOMEDS_SObject(_local_impl->GetFather()); - return new SALOMEDS_SObject(_corba_impl->GetFather()); + if(_isLocal) return _PTR(SObject)(new SALOMEDS_SObject(_local_impl->GetFather())); + return _PTR(SObject)(new SALOMEDS_SObject(_corba_impl->GetFather())); } -bool SALOMEDS_SObject::FindAttribute(SALOMEDSClient_GenericAttribute*& anAttribute, const std::string& aTypeOfAttribute) +bool SALOMEDS_SObject::FindAttribute(_PTR(GenericAttribute)& anAttribute, const std::string& aTypeOfAttribute) { bool ret = false; if(_isLocal) { Handle(SALOMEDSImpl_GenericAttribute) anAttr; ret = _local_impl->FindAttribute(anAttr, (char*)aTypeOfAttribute.c_str()); - if(ret) anAttribute = SALOMEDS_GenericAttribute::CreateAttribute(anAttr); + if(ret) anAttribute = _PTR(GenericAttribute)(SALOMEDS_GenericAttribute::CreateAttribute(anAttr)); } else { SALOMEDS::GenericAttribute_var anAttr; ret = _corba_impl->FindAttribute(anAttr.out(), aTypeOfAttribute.c_str()); - if(ret) anAttribute = SALOMEDS_GenericAttribute::CreateAttribute(anAttr); + if(ret) anAttribute = _PTR(GenericAttribute)(SALOMEDS_GenericAttribute::CreateAttribute(anAttr)); } return ret; } -bool SALOMEDS_SObject::ReferencedObject(SALOMEDSClient_SObject*& theObject) +bool SALOMEDS_SObject::ReferencedObject(_PTR(SObject)& theObject) { bool ret = false; if(_isLocal) { Handle(SALOMEDSImpl_SObject) aSO; ret = _local_impl->ReferencedObject(aSO); - if(ret) theObject = new SALOMEDS_SObject(aSO); + if(ret) theObject = _PTR(SObject)(new SALOMEDS_SObject(aSO)); } else { SALOMEDS::SObject_var aSO; ret = _corba_impl->ReferencedObject(aSO.out()); - if(ret) theObject = new SALOMEDS_SObject(aSO); + if(ret) theObject = _PTR(SObject)(new SALOMEDS_SObject(aSO)); } return ret; } -bool SALOMEDS_SObject::FindSubObject(int theTag, SALOMEDSClient_SObject*& theObject) +bool SALOMEDS_SObject::FindSubObject(int theTag, _PTR(SObject)& theObject) { bool ret = false; if(_isLocal) { Handle(SALOMEDSImpl_SObject) aSO; ret = _local_impl->FindSubObject(theTag, aSO); - if(ret) theObject = new SALOMEDS_SObject(aSO); + if(ret) theObject = _PTR(SObject)(new SALOMEDS_SObject(aSO)); } else { SALOMEDS::SObject_var aSO; ret = _corba_impl->FindSubObject(theTag, aSO.out()); - if(ret) theObject = new SALOMEDS_SObject(aSO); + if(ret) theObject = _PTR(SObject)(new SALOMEDS_SObject(aSO)); } return ret; } -SALOMEDSClient_Study* SALOMEDS_SObject::GetStudy() +_PTR(Study) SALOMEDS_SObject::GetStudy() { - if(_isLocal) return new SALOMEDS_Study(_local_impl->GetStudy()); - return new SALOMEDS_Study(_corba_impl->GetStudy()); + if(_isLocal) return _PTR(Study)(new SALOMEDS_Study(_local_impl->GetStudy())); + return _PTR(Study)(new SALOMEDS_Study(_corba_impl->GetStudy())); } std::string SALOMEDS_SObject::Name() @@ -159,18 +161,18 @@ void SALOMEDS_SObject::Name(const std::string& theName) else _corba_impl->Name(theName.c_str()); } -vector SALOMEDS_SObject::GetAllAttributes() +vector<_PTR(GenericAttribute)> SALOMEDS_SObject::GetAllAttributes() { - vector aVector; + vector<_PTR(GenericAttribute)> aVector; int aLength = 0; - SALOMEDS_GenericAttribute* anAttr; + SALOMEDSClient_GenericAttribute* anAttr; if(_isLocal) { Handle(TColStd_HSequenceOfTransient) aSeq = _local_impl->GetAllAttributes(); aLength = aSeq->Length(); for(int i = 1; i <= aLength; i++) { anAttr = SALOMEDS_GenericAttribute::CreateAttribute(Handle(SALOMEDSImpl_GenericAttribute)::DownCast(aSeq->Value(i))); - aVector.push_back(anAttr); + aVector.push_back(_PTR(GenericAttribute)(anAttr)); } } else { @@ -178,7 +180,7 @@ vector SALOMEDS_SObject::GetAllAttributes() aLength = aSeq->length(); for(int i = 0; i < aLength; i++) { anAttr = SALOMEDS_GenericAttribute::CreateAttribute(aSeq[i]); - aVector.push_back(anAttr); + aVector.push_back(_PTR(GenericAttribute)(anAttr)); } } diff --git a/src/SALOMEDS/SALOMEDS_SObject.hxx b/src/SALOMEDS/SALOMEDS_SObject.hxx index d6cf5687c..234194634 100644 --- a/src/SALOMEDS/SALOMEDS_SObject.hxx +++ b/src/SALOMEDS/SALOMEDS_SObject.hxx @@ -8,9 +8,7 @@ // std C++ headers #include -#include -#include -#include +#include // IDL headers #include @@ -35,15 +33,15 @@ public: virtual ~SALOMEDS_SObject(); virtual std::string GetID(); - virtual SALOMEDSClient_SComponent* GetFatherComponent(); - virtual SALOMEDSClient_SObject* GetFather(); - virtual bool FindAttribute(SALOMEDSClient_GenericAttribute*& anAttribute, const std::string& aTypeOfAttribute); - virtual bool ReferencedObject(SALOMEDSClient_SObject*& theObject); - virtual bool FindSubObject(int theTag, SALOMEDSClient_SObject*& theObject); - virtual SALOMEDSClient_Study* GetStudy(); + virtual _PTR(SComponent) GetFatherComponent(); + virtual _PTR(SObject) GetFather(); + virtual bool FindAttribute(_PTR(GenericAttribute)& anAttribute, const std::string& aTypeOfAttribute); + virtual bool ReferencedObject(_PTR(SObject)& theObject); + virtual bool FindSubObject(int theTag, _PTR(SObject)& theObject); + virtual _PTR(Study) GetStudy(); virtual std::string Name(); virtual void Name(const std::string& theName); - virtual vector GetAllAttributes(); + virtual vector<_PTR(GenericAttribute)> GetAllAttributes(); virtual std::string GetName(); virtual std::string GetComment(); virtual std::string GetIOR(); diff --git a/src/SALOMEDS/SALOMEDS_Study.cxx b/src/SALOMEDS/SALOMEDS_Study.cxx index 7c7038684..5e60f9270 100644 --- a/src/SALOMEDS/SALOMEDS_Study.cxx +++ b/src/SALOMEDS/SALOMEDS_Study.cxx @@ -98,137 +98,140 @@ bool SALOMEDS_Study::IsEmpty() return ret; } -SALOMEDSClient_SComponent* SALOMEDS_Study::FindComponent (const std::string& aComponentName) +_PTR(SComponent) SALOMEDS_Study::FindComponent (const std::string& aComponentName) { - SALOMEDS_SComponent* aSCO = NULL; + SALOMEDSClient_SComponent* aSCO = NULL; if(_isLocal) { Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->FindComponent((char*)aComponentName.c_str()); - if(aSCO_impl.IsNull()) return NULL; + if(aSCO_impl.IsNull()) return _PTR(SComponent)(aSCO); aSCO = new SALOMEDS_SComponent(aSCO_impl); } else { SALOMEDS::SComponent_var aSCO_impl = _corba_impl->FindComponent((char*)aComponentName.c_str()); - if(CORBA::is_nil(aSCO_impl)) return NULL; + if(CORBA::is_nil(aSCO_impl)) return _PTR(SComponent)(aSCO); aSCO = new SALOMEDS_SComponent(aSCO_impl); } - return aSCO; + return _PTR(SComponent)(aSCO); } -SALOMEDSClient_SComponent* SALOMEDS_Study::FindComponentID(const std::string& aComponentID) +_PTR(SComponent) SALOMEDS_Study::FindComponentID(const std::string& aComponentID) { - SALOMEDS_SComponent* aSCO = NULL; + SALOMEDSClient_SComponent* aSCO = NULL; if(_isLocal) { Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->FindComponentID((char*)aComponentID.c_str()); - if(aSCO_impl.IsNull()) return NULL; + if(aSCO_impl.IsNull()) return _PTR(SComponent)(aSCO); aSCO = new SALOMEDS_SComponent(aSCO_impl); } else { SALOMEDS::SComponent_var aSCO_impl = _corba_impl->FindComponentID((char*)aComponentID.c_str()); - if(CORBA::is_nil(aSCO_impl)) return NULL; + if(CORBA::is_nil(aSCO_impl)) return _PTR(SComponent)(aSCO); aSCO = new SALOMEDS_SComponent(aSCO_impl); } - return aSCO; + return _PTR(SComponent)(aSCO); } -SALOMEDSClient_SObject* SALOMEDS_Study::FindObject(const std::string& anObjectName) +_PTR(SObject) SALOMEDS_Study::FindObject(const std::string& anObjectName) { + SALOMEDSClient_SObject* aSO = NULL; + if(_isLocal) { Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObject((char*)anObjectName.c_str()); - if(aSO_impl.IsNull()) return NULL; + if(aSO_impl.IsNull()) return _PTR(SObject)(aSO); Handle(SALOMEDSImpl_SComponent) aSCO_impl = Handle(SALOMEDSImpl_SComponent)::DownCast(aSO_impl); - if(!aSCO_impl.IsNull()) return new SALOMEDS_SComponent(aSCO_impl); - return new SALOMEDS_SObject(aSO_impl); + if(!aSCO_impl.IsNull()) return _PTR(SObject)(new SALOMEDS_SComponent(aSCO_impl)); } else { SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObject((char*)anObjectName.c_str()); - if(CORBA::is_nil(aSO_impl)) return NULL; + if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO); SALOMEDS::SComponent_var aSCO_impl = SALOMEDS::SComponent::_narrow(aSO_impl); - if(!CORBA::is_nil(aSCO_impl)) return new SALOMEDS_SComponent(aSCO_impl); - return new SALOMEDS_SObject(aSO_impl); + if(!CORBA::is_nil(aSCO_impl)) return _PTR(SObject)(new SALOMEDS_SComponent(aSCO_impl)); } - return NULL; + + return _PTR(SObject)(aSO); } -std::vector SALOMEDS_Study::FindObjectByName(const std::string& anObjectName, +std::vector<_PTR(SObject)> SALOMEDS_Study::FindObjectByName(const std::string& anObjectName, const std::string& aComponentName) { - std::vector aVector; + std::vector<_PTR(SObject)> aVector; int i, aLength = 0; if(_isLocal) { Handle(TColStd_HSequenceOfTransient) aSeq = _local_impl->FindObjectByName((char*)anObjectName.c_str(), (char*)aComponentName.c_str()); aLength = aSeq->Length(); for(i = 1; i<= aLength; i++) - aVector.push_back(new SALOMEDS_SObject(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i)))); + aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i))))); } else { - SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindObjectByName((char*)anObjectName.c_str(), (char*)aComponentName.c_str()); + SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindObjectByName((char*)anObjectName.c_str(), + (char*)aComponentName.c_str()); aLength = aSeq->length(); - for(i = 0; i< aLength; i++) aVector.push_back(new SALOMEDS_SObject(aSeq[i])); + for(i = 0; i< aLength; i++) aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(aSeq[i]))); } return aVector; } -SALOMEDSClient_SObject* SALOMEDS_Study::FindObjectID(const std::string& anObjectID) +_PTR(SObject) SALOMEDS_Study::FindObjectID(const std::string& anObjectID) { + SALOMEDSClient_SObject* aSO = NULL; if(_isLocal) { Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectID((char*)anObjectID.c_str()); - if(aSO_impl.IsNull()) return NULL; - return new SALOMEDS_SObject(aSO_impl); + if(aSO_impl.IsNull()) return _PTR(SObject)(aSO); + return _PTR(SObject)(new SALOMEDS_SObject(aSO_impl)); } else { SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectID((char*)anObjectID.c_str()); - if(CORBA::is_nil(aSO_impl)) return NULL; - return new SALOMEDS_SObject(aSO_impl); + if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO); + return _PTR(SObject)(new SALOMEDS_SObject(aSO_impl)); } - return NULL; + return _PTR(SObject)(aSO); } -SALOMEDSClient_SObject* SALOMEDS_Study::CreateObjectID(const std::string& anObjectID) +_PTR(SObject) SALOMEDS_Study::CreateObjectID(const std::string& anObjectID) { - SALOMEDS_SObject* aSO = NULL; + SALOMEDSClient_SObject* aSO = NULL; if(_isLocal) aSO = new SALOMEDS_SObject(_local_impl->CreateObjectID((char*)anObjectID.c_str())); else aSO = new SALOMEDS_SObject(_corba_impl->CreateObjectID((char*)anObjectID.c_str())); - return aSO; + return _PTR(SObject)(aSO); } -SALOMEDSClient_SObject* SALOMEDS_Study::FindObjectIOR(const std::string& anObjectIOR) +_PTR(SObject) SALOMEDS_Study::FindObjectIOR(const std::string& anObjectIOR) { - SALOMEDS_SObject* aSO = NULL; + SALOMEDSClient_SObject* aSO = NULL; if(_isLocal) { Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectIOR((char*)anObjectIOR.c_str()); - if(aSO_impl.IsNull()) return NULL; + if(aSO_impl.IsNull()) return _PTR(SObject)(aSO); aSO = new SALOMEDS_SObject(aSO_impl); } else { SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectIOR((char*)anObjectIOR.c_str()); - if(CORBA::is_nil(aSO_impl)) return NULL; + if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO); aSO = new SALOMEDS_SObject(aSO_impl); } - return aSO; + return _PTR(SObject)(aSO); } -SALOMEDSClient_SObject* SALOMEDS_Study::FindObjectByPath(const std::string& thePath) +_PTR(SObject) SALOMEDS_Study::FindObjectByPath(const std::string& thePath) { - SALOMEDS_SObject* aSO = NULL; + SALOMEDSClient_SObject* aSO = NULL; if(_isLocal) { Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->FindObjectByPath((char*)thePath.c_str()); - if(aSO_impl.IsNull()) return NULL; + if(aSO_impl.IsNull()) return _PTR(SObject)(aSO); aSO = new SALOMEDS_SObject(aSO_impl); } else { SALOMEDS::SObject_var aSO_impl = _corba_impl->FindObjectByPath((char*)thePath.c_str()); - if(CORBA::is_nil(aSO_impl)) return NULL; + if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO); aSO = new SALOMEDS_SObject(aSO_impl); } - return aSO; + return _PTR(SObject)(aSO); } -std::string SALOMEDS_Study::GetObjectPath(SALOMEDSClient_SObject* theSO) +std::string SALOMEDS_Study::GetObjectPath(const _PTR(SObject)& theSO) { - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); std::string aPath; if(_isLocal) aPath = _local_impl->GetObjectPath(aSO->GetLocalImpl()).ToCString(); else aPath = _corba_impl->GetObjectPath(aSO->GetCORBAImpl()); @@ -318,10 +321,10 @@ std::vector SALOMEDS_Study::GetComponentNames(const std::string& th return aVector; } -SALOMEDSClient_ChildIterator* SALOMEDS_Study::NewChildIterator(SALOMEDSClient_SObject* theSO) +_PTR(ChildIterator) SALOMEDS_Study::NewChildIterator(const _PTR(SObject)& theSO) { - SALOMEDS_SObject* aSO = dynamic_cast(theSO); - SALOMEDS_ChildIterator* aCI = NULL; + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); + SALOMEDSClient_ChildIterator* aCI = NULL; if(_isLocal) { Handle(SALOMEDSImpl_ChildIterator) aCIimpl = _local_impl->NewChildIterator(aSO->GetLocalImpl()); aCI = new SALOMEDS_ChildIterator(aCIimpl); @@ -331,12 +334,12 @@ SALOMEDSClient_ChildIterator* SALOMEDS_Study::NewChildIterator(SALOMEDSClient_SO aCI = new SALOMEDS_ChildIterator(aCIimpl); } - return aCI; + return _PTR(ChildIterator)(aCI); } - -SALOMEDSClient_SComponentIterator* SALOMEDS_Study::NewComponentIterator() + +_PTR(SComponentIterator) SALOMEDS_Study::NewComponentIterator() { - SALOMEDS_SComponentIterator* aCI = NULL; + SALOMEDSClient_SComponentIterator* aCI = NULL; if(_isLocal) { SALOMEDSImpl_SComponentIterator aCIimpl = _local_impl->NewComponentIterator(); aCI = new SALOMEDS_SComponentIterator(aCIimpl); @@ -346,12 +349,12 @@ SALOMEDSClient_SComponentIterator* SALOMEDS_Study::NewComponentIterator() aCI = new SALOMEDS_SComponentIterator(aCIimpl); } - return aCI; + return _PTR(SComponentIterator)(aCI); } -SALOMEDSClient_StudyBuilder* SALOMEDS_Study::NewBuilder() +_PTR(StudyBuilder) SALOMEDS_Study::NewBuilder() { - SALOMEDS_StudyBuilder* aSB = NULL; + SALOMEDSClient_StudyBuilder* aSB = NULL; if(_isLocal) { Handle(SALOMEDSImpl_StudyBuilder) aSBimpl = _local_impl->NewBuilder(); aSB = new SALOMEDS_StudyBuilder(aSBimpl); @@ -361,7 +364,7 @@ SALOMEDSClient_StudyBuilder* SALOMEDS_Study::NewBuilder() aSB = new SALOMEDS_StudyBuilder(aSBimpl); } - return aSB; + return _PTR(StudyBuilder)(aSB); } std::string SALOMEDS_Study::Name() @@ -428,31 +431,31 @@ void SALOMEDS_Study::StudyId(int id) else _corba_impl->StudyId(id); } -std::vector SALOMEDS_Study::FindDependances(SALOMEDSClient_SObject* theSO) +std::vector<_PTR(SObject)> SALOMEDS_Study::FindDependances(const _PTR(SObject)& theSO) { - std::vector aVector; - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + std::vector<_PTR(SObject)> aVector; + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); int aLength, i; if(_isLocal) { Handle(TColStd_HSequenceOfTransient) aSeq = _local_impl->FindDependances(aSO->GetLocalImpl()); aLength = aSeq->Length(); for(i=1; i<=aLength; i++) - aVector.push_back(new SALOMEDS_SObject(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i)))); + aVector.push_back(_PTR(SObject)(new SALOMEDS_SObject(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i))))); } else { SALOMEDS::Study::ListOfSObject_var aSeq = _corba_impl->FindDependances(aSO->GetCORBAImpl()); aLength = aSeq->length(); - for(i=0; iGetProperties()); else aProp = new SALOMEDS_AttributeStudyProperties(_corba_impl->GetProperties()); - return aProp; + return _PTR(AttributeStudyProperties)(aProp); } std::string SALOMEDS_Study::GetLastModificationDate() @@ -480,9 +483,9 @@ std::vector SALOMEDS_Study::GetModificationsDate() return aVector; } -SALOMEDSClient_UseCaseBuilder* SALOMEDS_Study::GetUseCaseBuilder() +_PTR(UseCaseBuilder) SALOMEDS_Study::GetUseCaseBuilder() { - SALOMEDS_UseCaseBuilder* aUB = NULL; + SALOMEDSClient_UseCaseBuilder* aUB = NULL; if(_isLocal) { Handle(SALOMEDSImpl_UseCaseBuilder) aUBimpl = _local_impl->GetUseCaseBuilder(); aUB = new SALOMEDS_UseCaseBuilder(aUBimpl); @@ -492,7 +495,7 @@ SALOMEDSClient_UseCaseBuilder* SALOMEDS_Study::GetUseCaseBuilder() aUB = new SALOMEDS_UseCaseBuilder(aUBimpl); } - return aUB; + return _PTR(UseCaseBuilder)(aUB); } void SALOMEDS_Study::Close() diff --git a/src/SALOMEDS/SALOMEDS_Study.hxx b/src/SALOMEDS/SALOMEDS_Study.hxx index 686c3f8dc..46fbb2d33 100644 --- a/src/SALOMEDS/SALOMEDS_Study.hxx +++ b/src/SALOMEDS/SALOMEDS_Study.hxx @@ -8,15 +8,7 @@ #include #include -#include "SALOMEDSClient_Study.hxx" -#include "SALOMEDSClient_SComponentIterator.hxx" -#include "SALOMEDSClient_StudyBuilder.hxx" -#include "SALOMEDSClient_SObject.hxx" -#include "SALOMEDSClient_SComponent.hxx" -#include "SALOMEDSClient_UseCaseBuilder.hxx" -#include "SALOMEDSClient_AttributeStudyProperties.hxx" -#include "SALOMEDSClient_ChildIterator.hxx" - +#include "SALOMEDSClient.hxx" #include "SALOMEDSImpl_Study.hxx" // IDL headers @@ -41,24 +33,24 @@ public: virtual std::string GetPersistentReference(); virtual std::string GetTransientReference(); virtual bool IsEmpty(); - virtual SALOMEDSClient_SComponent* FindComponent (const std::string& aComponentName); - virtual SALOMEDSClient_SComponent* FindComponentID(const std::string& aComponentID); - virtual SALOMEDSClient_SObject* FindObject(const std::string& anObjectName); - virtual std::vector FindObjectByName( const std::string& anObjectName, const std::string& aComponentName ) ; - virtual SALOMEDSClient_SObject* FindObjectID(const std::string& anObjectID); - virtual SALOMEDSClient_SObject* CreateObjectID(const std::string& anObjectID); - virtual SALOMEDSClient_SObject* FindObjectIOR(const std::string& anObjectIOR); - virtual SALOMEDSClient_SObject* FindObjectByPath(const std::string& thePath); - virtual std::string GetObjectPath(SALOMEDSClient_SObject* theSO); + virtual _PTR(SComponent) FindComponent (const std::string& aComponentName); + virtual _PTR(SComponent) FindComponentID(const std::string& aComponentID); + virtual _PTR(SObject) FindObject(const std::string& anObjectName); + virtual std::vector<_PTR(SObject)> FindObjectByName( const std::string& anObjectName, const std::string& aComponentName ) ; + virtual _PTR(SObject) FindObjectID(const std::string& anObjectID); + virtual _PTR(SObject) CreateObjectID(const std::string& anObjectID); + virtual _PTR(SObject) FindObjectIOR(const std::string& anObjectIOR); + virtual _PTR(SObject) FindObjectByPath(const std::string& thePath); + virtual std::string GetObjectPath(const _PTR(SObject)& theSO); virtual void SetContext(const std::string& thePath); virtual std::string GetContext(); virtual std::vector GetObjectNames(const std::string& theContext); virtual std::vector GetDirectoryNames(const std::string& theContext); virtual std::vector GetFileNames(const std::string& theContext); virtual std::vector GetComponentNames(const std::string& theContext); - virtual SALOMEDSClient_ChildIterator* NewChildIterator(SALOMEDSClient_SObject* theSO); - virtual SALOMEDSClient_SComponentIterator* NewComponentIterator(); - virtual SALOMEDSClient_StudyBuilder* NewBuilder(); + virtual _PTR(ChildIterator) NewChildIterator(const _PTR(SObject)& theSO); + virtual _PTR(SComponentIterator) NewComponentIterator(); + virtual _PTR(StudyBuilder) NewBuilder(); virtual std::string Name(); virtual void Name(const std::string& name); virtual bool IsSaved(); @@ -68,11 +60,11 @@ public: virtual void URL(const std::string& url); virtual int StudyId(); virtual void StudyId(int id); - virtual std::vector FindDependances(SALOMEDSClient_SObject* theSO); - virtual SALOMEDSClient_AttributeStudyProperties* GetProperties(); + virtual std::vector<_PTR(SObject)> FindDependances(const _PTR(SObject)& theSO); + virtual _PTR(AttributeStudyProperties) GetProperties(); virtual std::string GetLastModificationDate(); virtual std::vector GetModificationsDate(); - virtual SALOMEDSClient_UseCaseBuilder* GetUseCaseBuilder(); + virtual _PTR(UseCaseBuilder) GetUseCaseBuilder(); virtual void Close(); virtual void EnableUseCaseAutoFilling(bool isEnabled); virtual bool DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished); diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx b/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx index ab69a2e32..08f81403b 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder.cxx @@ -45,32 +45,32 @@ SALOMEDS_StudyBuilder::~SALOMEDS_StudyBuilder() { } -SALOMEDSClient_SComponent* SALOMEDS_StudyBuilder::NewComponent(const std::string& ComponentDataType) +_PTR(SComponent) SALOMEDS_StudyBuilder::NewComponent(const std::string& ComponentDataType) { CheckLocked(); - SALOMEDS_SComponent* aSCO = NULL; + SALOMEDSClient_SComponent* aSCO = NULL; if(_isLocal) { Handle(SALOMEDSImpl_SComponent) aSCO_impl =_local_impl->NewComponent((char*)ComponentDataType.c_str()); - if(aSCO_impl.IsNull()) return NULL; + if(aSCO_impl.IsNull()) return _PTR(SComponent)(aSCO); aSCO = new SALOMEDS_SComponent(aSCO_impl); } else { SALOMEDS::SComponent_var aSCO_impl = _corba_impl->NewComponent((char*)ComponentDataType.c_str()); - if(CORBA::is_nil(aSCO_impl)) return NULL; + if(CORBA::is_nil(aSCO_impl)) return _PTR(SComponent)(aSCO); aSCO = new SALOMEDS_SComponent(aSCO_impl); } - return aSCO; + return _PTR(SComponent)(aSCO); } -void SALOMEDS_StudyBuilder::DefineComponentInstance (SALOMEDSClient_SComponent* theSCO, +void SALOMEDS_StudyBuilder::DefineComponentInstance (const _PTR(SComponent)& theSCO, const std::string& ComponentIOR) { CheckLocked(); - SALOMEDS_SComponent* aSCO = dynamic_cast(theSCO); + SALOMEDS_SComponent* aSCO = dynamic_cast(theSCO.get()); if(_isLocal) _local_impl->DefineComponentInstance(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl()), (char*)ComponentIOR.c_str()); else { @@ -79,55 +79,55 @@ void SALOMEDS_StudyBuilder::DefineComponentInstance (SALOMEDSClient_SComponent* } } -void SALOMEDS_StudyBuilder::RemoveComponent(SALOMEDSClient_SComponent* theSCO) +void SALOMEDS_StudyBuilder::RemoveComponent(const _PTR(SComponent)& theSCO) { CheckLocked(); - SALOMEDS_SComponent* aSCO = dynamic_cast(theSCO); + SALOMEDS_SComponent* aSCO = dynamic_cast(theSCO.get()); if(_isLocal) _local_impl->RemoveComponent(Handle(SALOMEDSImpl_SComponent)::DownCast(aSCO->GetLocalImpl())); else _corba_impl->RemoveComponent(SALOMEDS::SComponent::_narrow(aSCO->GetCORBAImpl())); } -SALOMEDSClient_SObject* SALOMEDS_StudyBuilder::NewObject(SALOMEDSClient_SObject* theFatherObject) +_PTR(SObject) SALOMEDS_StudyBuilder::NewObject(const _PTR(SObject)& theFatherObject) { CheckLocked(); - SALOMEDS_SObject* aSO = NULL; - SALOMEDS_SObject* father = dynamic_cast< SALOMEDS_SObject*>(theFatherObject); - if(father == NULL) return aSO; + SALOMEDSClient_SObject* aSO = NULL; + SALOMEDS_SObject* father = dynamic_cast< SALOMEDS_SObject*>(theFatherObject.get()); + if(father == NULL) return _PTR(SObject)(aSO); if(_isLocal) { Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->NewObject(father->GetLocalImpl()); - if(aSO_impl.IsNull()) return NULL; + if(aSO_impl.IsNull()) return _PTR(SObject)(aSO); aSO = new SALOMEDS_SObject(aSO_impl); } else { SALOMEDS::SObject_var aSO_impl = _corba_impl->NewObject(father->GetCORBAImpl()); - if(CORBA::is_nil(aSO_impl)) return NULL; + if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO); aSO = new SALOMEDS_SObject(aSO_impl); } - return aSO; + return _PTR(SObject)(aSO); } -SALOMEDSClient_SObject* SALOMEDS_StudyBuilder::NewObjectToTag(SALOMEDSClient_SObject* theFatherObject, int theTag) +_PTR(SObject) SALOMEDS_StudyBuilder::NewObjectToTag(const _PTR(SObject)& theFatherObject, int theTag) { CheckLocked(); - SALOMEDS_SObject* aSO = NULL; - SALOMEDS_SObject* father = dynamic_cast< SALOMEDS_SObject*>(theFatherObject); - if(father == NULL) return aSO; + SALOMEDSClient_SObject* aSO = NULL; + SALOMEDS_SObject* father = dynamic_cast< SALOMEDS_SObject*>(theFatherObject.get()); + if(father == NULL) return _PTR(SObject)(aSO); if(_isLocal) { Handle(SALOMEDSImpl_SObject) aSO_impl = _local_impl->NewObjectToTag(father->GetLocalImpl(), theTag); - if(aSO_impl.IsNull()) return NULL; + if(aSO_impl.IsNull()) return _PTR(SObject)(aSO); aSO = new SALOMEDS_SObject(aSO_impl); } else { SALOMEDS::SObject_var aSO_impl = _corba_impl->NewObjectToTag(father->GetCORBAImpl(), theTag); - if(CORBA::is_nil(aSO_impl)) return NULL; + if(CORBA::is_nil(aSO_impl)) return _PTR(SObject)(aSO); aSO = new SALOMEDS_SObject(aSO_impl); } - return aSO; + return _PTR(SObject)(aSO); } @@ -147,9 +147,9 @@ void SALOMEDS_StudyBuilder::AddDirectory(const std::string& thePath) else _corba_impl->AddDirectory((char*)thePath.c_str()); } -void SALOMEDS_StudyBuilder::LoadWith(SALOMEDSClient_SComponent* theSCO, const std::string& theIOR) +void SALOMEDS_StudyBuilder::LoadWith(const _PTR(SComponent)& theSCO, const std::string& theIOR) { - SALOMEDS_SComponent* aSCO = dynamic_cast(theSCO); + SALOMEDS_SComponent* aSCO = dynamic_cast(theSCO.get()); CORBA::Object_var obj = _orb->string_to_object(theIOR.c_str()); SALOMEDS::Driver_var aDriver = SALOMEDS::Driver::_narrow(obj); @@ -166,36 +166,36 @@ void SALOMEDS_StudyBuilder::LoadWith(SALOMEDSClient_SComponent* theSCO, const st } } -void SALOMEDS_StudyBuilder::Load(SALOMEDSClient_SObject* theSCO) +void SALOMEDS_StudyBuilder::Load(const _PTR(SObject)& theSCO) { - SALOMEDS_SComponent* aSCO = dynamic_cast(theSCO); + SALOMEDS_SComponent* aSCO = dynamic_cast(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(SALOMEDSClient_SObject* theSO) +void SALOMEDS_StudyBuilder::RemoveObject(const _PTR(SObject)& theSO) { CheckLocked(); - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); if(_isLocal) _local_impl->RemoveObject(aSO->GetLocalImpl()); else _corba_impl->RemoveObject(aSO->GetCORBAImpl()); } -void SALOMEDS_StudyBuilder::RemoveObjectWithChildren(SALOMEDSClient_SObject* theSO) +void SALOMEDS_StudyBuilder::RemoveObjectWithChildren(const _PTR(SObject)& theSO) { CheckLocked(); - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); if(_isLocal) _local_impl->RemoveObjectWithChildren(aSO->GetLocalImpl()); else _corba_impl->RemoveObjectWithChildren(aSO->GetCORBAImpl()); } -SALOMEDSClient_GenericAttribute* SALOMEDS_StudyBuilder::FindOrCreateAttribute(SALOMEDSClient_SObject* theSO, - const std::string& aTypeOfAttribute) +_PTR(GenericAttribute) SALOMEDS_StudyBuilder::FindOrCreateAttribute(const _PTR(SObject)& theSO, + const std::string& aTypeOfAttribute) { - SALOMEDS_SObject* aSO = dynamic_cast(theSO); - SALOMEDS_GenericAttribute* anAttr = NULL; + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); + SALOMEDSClient_GenericAttribute* anAttr = NULL; if(_isLocal) { Handle(SALOMEDSImpl_GenericAttribute) aGA; try { @@ -212,70 +212,69 @@ SALOMEDSClient_GenericAttribute* SALOMEDS_StudyBuilder::FindOrCreateAttribute(SA anAttr = SALOMEDS_GenericAttribute::CreateAttribute(aGA); } - return anAttr; + return _PTR(GenericAttribute)(anAttr); } -bool SALOMEDS_StudyBuilder::FindAttribute(SALOMEDSClient_SObject* theSO, - SALOMEDSClient_GenericAttribute* anAttribute, +bool SALOMEDS_StudyBuilder::FindAttribute(const _PTR(SObject)& theSO, + _PTR(GenericAttribute)& anAttribute, const std::string& aTypeOfAttribute) { bool ret; - SALOMEDS_SObject* aSO = dynamic_cast(theSO); - anAttribute = NULL; + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); if(_isLocal) { Handle(SALOMEDSImpl_GenericAttribute) aGA; ret = _local_impl->FindAttribute(aSO->GetLocalImpl(), aGA, (char*)aTypeOfAttribute.c_str()); - if(ret) anAttribute = SALOMEDS_GenericAttribute::CreateAttribute(aGA); + if(ret) anAttribute = _PTR(GenericAttribute)(SALOMEDS_GenericAttribute::CreateAttribute(aGA)); } else { SALOMEDS::GenericAttribute_var aGA; ret = _corba_impl->FindAttribute(aSO->GetCORBAImpl(), aGA.out(), (char*)aTypeOfAttribute.c_str()); - if(ret) anAttribute = SALOMEDS_GenericAttribute::CreateAttribute(aGA); + if(ret) anAttribute = _PTR(GenericAttribute)(SALOMEDS_GenericAttribute::CreateAttribute(aGA)); } return ret; } -void SALOMEDS_StudyBuilder::RemoveAttribute(SALOMEDSClient_SObject* theSO, const std::string& aTypeOfAttribute) +void SALOMEDS_StudyBuilder::RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute) { CheckLocked(); - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); if(_isLocal) _local_impl->RemoveAttribute(aSO->GetLocalImpl(), (char*)aTypeOfAttribute.c_str()); else _corba_impl->RemoveAttribute(aSO->GetCORBAImpl(), (char*)aTypeOfAttribute.c_str()); } -void SALOMEDS_StudyBuilder::Addreference(SALOMEDSClient_SObject* me, SALOMEDSClient_SObject* thereferencedObject) +void SALOMEDS_StudyBuilder::Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject) { CheckLocked(); - SALOMEDS_SObject* aSO = dynamic_cast(me); - SALOMEDS_SObject* aRefSO = dynamic_cast(thereferencedObject); + SALOMEDS_SObject* aSO = dynamic_cast(me.get()); + SALOMEDS_SObject* aRefSO = dynamic_cast(thereferencedObject.get()); if(_isLocal) _local_impl->Addreference(aSO->GetLocalImpl(), aRefSO->GetLocalImpl()); else _corba_impl->Addreference(aSO->GetCORBAImpl(), aRefSO->GetCORBAImpl()); } -void SALOMEDS_StudyBuilder::RemoveReference(SALOMEDSClient_SObject* me) +void SALOMEDS_StudyBuilder::RemoveReference(const _PTR(SObject)& me) { CheckLocked(); - SALOMEDS_SObject* aSO = dynamic_cast(me); + SALOMEDS_SObject* aSO = dynamic_cast(me.get()); if(_isLocal) _local_impl->RemoveReference(aSO->GetLocalImpl()); else _corba_impl->RemoveReference(aSO->GetCORBAImpl()); } -void SALOMEDS_StudyBuilder::SetGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID) +void SALOMEDS_StudyBuilder::SetGUID(const _PTR(SObject)& theSO, const std::string& theGUID) { CheckLocked(); - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); if(_isLocal) _local_impl->SetGUID(aSO->GetLocalImpl(), (char*)theGUID.c_str()); else _corba_impl->SetGUID(aSO->GetCORBAImpl(), (char*)theGUID.c_str()); } -bool SALOMEDS_StudyBuilder::IsGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID) +bool SALOMEDS_StudyBuilder::IsGUID(const _PTR(SObject)& theSO, const std::string& theGUID) { - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); bool ret; if(_isLocal) ret = _local_impl->IsGUID(aSO->GetLocalImpl(), (char*)theGUID.c_str()); else ret = _corba_impl->IsGUID(aSO->GetCORBAImpl(), (char*)theGUID.c_str()); @@ -387,29 +386,29 @@ void SALOMEDS_StudyBuilder::CheckLocked() } } -void SALOMEDS_StudyBuilder::SetName(SALOMEDSClient_SObject* theSO, const std::string& theValue) +void SALOMEDS_StudyBuilder::SetName(const _PTR(SObject)& theSO, const std::string& theValue) { CheckLocked(); - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); if(_isLocal) _local_impl->SetName(aSO->GetLocalImpl(), (char*)theValue.c_str()); else _corba_impl->SetName(aSO->GetCORBAImpl(), (char*)theValue.c_str()); } -void SALOMEDS_StudyBuilder::SetComment(SALOMEDSClient_SObject* theSO, const std::string& theValue) +void SALOMEDS_StudyBuilder::SetComment(const _PTR(SObject)& theSO, const std::string& theValue) { CheckLocked(); - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); if(_isLocal) _local_impl->SetComment(aSO->GetLocalImpl(), (char*)theValue.c_str()); else _corba_impl->SetComment(aSO->GetCORBAImpl(), (char*)theValue.c_str()); } -void SALOMEDS_StudyBuilder::SetIOR(SALOMEDSClient_SObject* theSO, const std::string& theValue) +void SALOMEDS_StudyBuilder::SetIOR(const _PTR(SObject)& theSO, const std::string& theValue) { CheckLocked(); - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); if(_isLocal) _local_impl->SetIOR(aSO->GetLocalImpl(), (char*)theValue.c_str()); else _corba_impl->SetIOR(aSO->GetCORBAImpl(), (char*)theValue.c_str()); } diff --git a/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx b/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx index 0302c1268..f13561376 100644 --- a/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx +++ b/src/SALOMEDS/SALOMEDS_StudyBuilder.hxx @@ -5,10 +5,7 @@ #ifndef __SALOMEDS_STUDYBUILDER_H__ #define __SALOMEDS_STUDYBUILDER_H__ -#include "SALOMEDSClient_StudyBuilder.hxx" -#include "SALOMEDSClient_SObject.hxx" -#include "SALOMEDSClient_SComponent.hxx" -#include "SALOMEDSClient_GenericAttribute.hxx" +#include "SALOMEDSClient.hxx" #include "SALOMEDSImpl_StudyBuilder.hxx" // IDL headers @@ -30,26 +27,26 @@ public: SALOMEDS_StudyBuilder(SALOMEDS::StudyBuilder_ptr theBuilder); ~SALOMEDS_StudyBuilder(); - virtual SALOMEDSClient_SComponent* NewComponent(const std::string& ComponentDataType); - virtual void DefineComponentInstance (SALOMEDSClient_SComponent*, const std::string& ComponentIOR); - virtual void RemoveComponent(SALOMEDSClient_SComponent* theSCO); - virtual SALOMEDSClient_SObject* NewObject(SALOMEDSClient_SObject* theFatherObject); - virtual SALOMEDSClient_SObject* NewObjectToTag(SALOMEDSClient_SObject* theFatherObject, int theTag); + virtual _PTR(SComponent) NewComponent(const std::string& ComponentDataType); + virtual void DefineComponentInstance (const _PTR(SComponent)&, const std::string& ComponentIOR); + virtual void RemoveComponent(const _PTR(SComponent)& theSCO); + virtual _PTR(SObject) NewObject(const _PTR(SObject)& theFatherObject); + virtual _PTR(SObject) NewObjectToTag(const _PTR(SObject)& theFatherObject, int theTag); virtual void AddDirectory(const std::string& thePath); - virtual void LoadWith(SALOMEDSClient_SComponent* theSCO, const std::string& theIOR); - virtual void Load(SALOMEDSClient_SObject* theSCO); - virtual void RemoveObject(SALOMEDSClient_SObject* theSO); - virtual void RemoveObjectWithChildren(SALOMEDSClient_SObject* theSO); - virtual SALOMEDSClient_GenericAttribute* FindOrCreateAttribute(SALOMEDSClient_SObject* theSO, - const std::string& aTypeOfAttribute); - virtual bool FindAttribute(SALOMEDSClient_SObject* theSO, - SALOMEDSClient_GenericAttribute* theAttribute, + virtual void LoadWith(const _PTR(SComponent)& theSCO, const std::string& theIOR); + virtual void Load(const _PTR(SObject)& theSCO); + virtual void RemoveObject(const _PTR(SObject)& theSO); + virtual void RemoveObjectWithChildren(const _PTR(SObject)& theSO); + virtual _PTR(GenericAttribute) FindOrCreateAttribute(const _PTR(SObject)& theSO, + const std::string& aTypeOfAttribute); + virtual bool FindAttribute(const _PTR(SObject)& theSO, + _PTR(GenericAttribute)& theAttribute, const std::string& aTypeOfAttribute); - virtual void RemoveAttribute(SALOMEDSClient_SObject* theSO, const std::string& aTypeOfAttribute); - virtual void Addreference(SALOMEDSClient_SObject* me, SALOMEDSClient_SObject* thereferencedObject); - virtual void RemoveReference(SALOMEDSClient_SObject* me); - virtual void SetGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID); - virtual bool IsGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID); + virtual void RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute); + virtual void Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject); + virtual void RemoveReference(const _PTR(SObject)& me); + virtual void SetGUID(const _PTR(SObject)& theSO, const std::string& theGUID); + virtual bool IsGUID(const _PTR(SObject)& theSO, const std::string& theGUID); virtual void NewCommand(); virtual void CommitCommand(); virtual bool HasOpenCommand(); @@ -60,9 +57,9 @@ public: virtual bool GetAvailableRedos(); virtual int UndoLimit(); virtual void UndoLimit(int theLimit); - virtual void SetName(SALOMEDSClient_SObject* theSO, const std::string& theValue); - virtual void SetComment(SALOMEDSClient_SObject* theSO, const std::string& theValue); - virtual void SetIOR(SALOMEDSClient_SObject* theSO, const std::string& theValue); + virtual void SetName(const _PTR(SObject)& theSO, const std::string& theValue); + virtual void SetComment(const _PTR(SObject)& theSO, const std::string& theValue); + virtual void SetIOR(const _PTR(SObject)& theSO, const std::string& theValue); private: void CheckLocked(); diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.cxx b/src/SALOMEDS/SALOMEDS_StudyManager.cxx index 6a8e2f649..640c76b99 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.cxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.cxx @@ -54,72 +54,72 @@ SALOMEDS_StudyManager::~SALOMEDS_StudyManager() { } -SALOMEDSClient_Study* SALOMEDS_StudyManager::NewStudy(const std::string& study_name) +_PTR(Study) SALOMEDS_StudyManager::NewStudy(const std::string& study_name) { - SALOMEDS_Study* aStudy; + SALOMEDSClient_Study* aStudy = NULL; if(_isLocal) { Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->NewStudy((char*)study_name.c_str()); - if(aStudy_impl.IsNull()) return NULL; + if(aStudy_impl.IsNull()) return _PTR(Study)(aStudy); aStudy = new SALOMEDS_Study(aStudy_impl); } else { SALOMEDS::Study_var aStudy_impl = _corba_impl->NewStudy((char*)study_name.c_str()); - if(CORBA::is_nil(aStudy_impl)) return NULL; + if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy); aStudy = new SALOMEDS_Study(aStudy_impl); } - return aStudy; + return _PTR(Study)(aStudy); } -SALOMEDSClient_Study* SALOMEDS_StudyManager::Open(const std::string& theStudyUrl) +_PTR(Study) SALOMEDS_StudyManager::Open(const std::string& theStudyUrl) { - SALOMEDS_Study* aStudy; + SALOMEDSClient_Study* aStudy = NULL; if(_isLocal) { Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->Open((char*)theStudyUrl.c_str()); - if(aStudy_impl.IsNull()) return NULL; + if(aStudy_impl.IsNull()) return _PTR(Study)(aStudy); aStudy = new SALOMEDS_Study(aStudy_impl); } else { SALOMEDS::Study_var aStudy_impl = _corba_impl->Open((char*)theStudyUrl.c_str()); - if(CORBA::is_nil(aStudy_impl)) return NULL; + if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy); aStudy = new SALOMEDS_Study(aStudy_impl.in()); } - return aStudy; + return _PTR(Study)(aStudy); } -void SALOMEDS_StudyManager::Close( SALOMEDSClient_Study* theStudy) +void SALOMEDS_StudyManager::Close(const _PTR(Study)& theStudy) { //SRN: Pure CORBA close as it does more cleaning then the local one SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId()); _corba_impl->Close(aStudy); } -void SALOMEDS_StudyManager::Save( SALOMEDSClient_Study* theStudy, bool theMultiFile) +void SALOMEDS_StudyManager::Save(const _PTR(Study)& theStudy, bool theMultiFile) { //SRN: Pure CORBA save as the save operation require CORBA in any case SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId()); _corba_impl->Save(aStudy, theMultiFile); } -void SALOMEDS_StudyManager::SaveASCII( SALOMEDSClient_Study* theStudy, bool theMultiFile) +void SALOMEDS_StudyManager::SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile) { //SRN: Pure CORBA save as the save operation require CORBA in any case SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId()); _corba_impl->SaveASCII(aStudy, theMultiFile); } -void SALOMEDS_StudyManager::SaveAs(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) +void SALOMEDS_StudyManager::SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) { //SRN: Pure CORBA save as the save operation require CORBA in any case SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId()); _corba_impl->SaveAs((char*)theUrl.c_str(), aStudy, theMultiFile); } -void SALOMEDS_StudyManager::SaveAsASCII(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) +void SALOMEDS_StudyManager::SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile) { //SRN: Pure CORBA save as the save operation require CORBA in any case SALOMEDS::Study_var aStudy = _corba_impl->GetStudyByID(theStudy->StudyId()); @@ -146,41 +146,41 @@ std::vector SALOMEDS_StudyManager::GetOpenStudies() return aVector; } -SALOMEDSClient_Study* SALOMEDS_StudyManager::GetStudyByName(const std::string& theStudyName) +_PTR(Study) SALOMEDS_StudyManager::GetStudyByName(const std::string& theStudyName) { - SALOMEDS_Study* aStudy = NULL; + SALOMEDSClient_Study* aStudy = NULL; if(_isLocal) { Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->GetStudyByName((char*)theStudyName.c_str()); - if(aStudy_impl.IsNull()) return NULL; + if(aStudy_impl.IsNull()) return _PTR(Study)(aStudy); aStudy = new SALOMEDS_Study(aStudy_impl); } else { SALOMEDS::Study_var aStudy_impl = _corba_impl->GetStudyByName((char*)theStudyName.c_str()); - if(CORBA::is_nil(aStudy_impl)) return NULL; + if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy); aStudy = new SALOMEDS_Study(aStudy_impl); } - return aStudy; + return _PTR(Study)(aStudy); } -SALOMEDSClient_Study* SALOMEDS_StudyManager::GetStudyByID(int theStudyID) +_PTR(Study) SALOMEDS_StudyManager::GetStudyByID(int theStudyID) { - SALOMEDS_Study* aStudy = NULL; + SALOMEDSClient_Study* aStudy = NULL; if(_isLocal) { Handle(SALOMEDSImpl_Study) aStudy_impl = _local_impl->GetStudyByID(theStudyID); - if(aStudy_impl.IsNull()) return NULL; + if(aStudy_impl.IsNull()) return _PTR(Study)(aStudy); aStudy = new SALOMEDS_Study(aStudy_impl); } else { SALOMEDS::Study_var aStudy_impl = _corba_impl->GetStudyByID(theStudyID); - if(CORBA::is_nil(aStudy_impl)) return NULL; + if(CORBA::is_nil(aStudy_impl)) return _PTR(Study)(aStudy); aStudy = new SALOMEDS_Study(aStudy_impl); } - return aStudy; + return _PTR(Study)(aStudy); } -bool SALOMEDS_StudyManager::CanCopy(SALOMEDSClient_SObject* theSO) +bool SALOMEDS_StudyManager::CanCopy(const _PTR(SObject)& theSO) { - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); bool ret; if(_isLocal) { @@ -196,9 +196,9 @@ bool SALOMEDS_StudyManager::CanCopy(SALOMEDSClient_SObject* theSO) return ret; } -bool SALOMEDS_StudyManager::Copy(SALOMEDSClient_SObject* theSO) +bool SALOMEDS_StudyManager::Copy(const _PTR(SObject)& theSO) { - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); bool ret; if(_isLocal) { Handle(SALOMEDSImpl_SObject) aSO_impl = aSO->GetLocalImpl(); @@ -212,9 +212,9 @@ bool SALOMEDS_StudyManager::Copy(SALOMEDSClient_SObject* theSO) return ret; } -bool SALOMEDS_StudyManager::CanPaste(SALOMEDSClient_SObject* theSO) +bool SALOMEDS_StudyManager::CanPaste(const _PTR(SObject)& theSO) { - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); bool ret; if(_isLocal) { @@ -230,9 +230,9 @@ bool SALOMEDS_StudyManager::CanPaste(SALOMEDSClient_SObject* theSO) return ret; } -SALOMEDSClient_SObject* SALOMEDS_StudyManager::Paste(SALOMEDSClient_SObject* theSO) +_PTR(SObject) SALOMEDS_StudyManager::Paste(const _PTR(SObject)& theSO) { - SALOMEDS_SObject* aSO = dynamic_cast(theSO); + SALOMEDS_SObject* aSO = dynamic_cast(theSO.get()); SALOMEDSClient_SObject* aResult = NULL; if(_isLocal) { @@ -240,16 +240,16 @@ SALOMEDSClient_SObject* SALOMEDS_StudyManager::Paste(SALOMEDSClient_SObject* the SALOMEDS_Driver_i* aDriver = GetDriver(aSO_impl, _orb); Handle(SALOMEDSImpl_SObject) aNewSO = _local_impl->Paste(aSO_impl, aDriver); delete aDriver; - if(aNewSO.IsNull()) return NULL; + if(aNewSO.IsNull()) return _PTR(SObject)(aResult); aResult = new SALOMEDS_SObject(aNewSO); } else { SALOMEDS::SObject_ptr aNewSO = _corba_impl->Paste(aSO->GetCORBAImpl()); - if(CORBA::is_nil(aNewSO)) return NULL; + if(CORBA::is_nil(aNewSO)) return _PTR(SObject)(aResult); aResult = new SALOMEDS_SObject(aNewSO); } - return aResult; + return _PTR(SObject)(aResult); } diff --git a/src/SALOMEDS/SALOMEDS_StudyManager.hxx b/src/SALOMEDS/SALOMEDS_StudyManager.hxx index 73d7adfb1..84ef897ca 100644 --- a/src/SALOMEDS/SALOMEDS_StudyManager.hxx +++ b/src/SALOMEDS/SALOMEDS_StudyManager.hxx @@ -8,8 +8,7 @@ #include #include -#include "SALOMEDSClient_StudyManager.hxx" -#include "SALOMEDSClient_Study.hxx" +#include "SALOMEDSClient.hxx" #include "SALOMEDSImpl_StudyManager.hxx" // IDL headers @@ -30,20 +29,20 @@ public: SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManager); ~SALOMEDS_StudyManager(); - virtual SALOMEDSClient_Study* NewStudy(const std::string& study_name); - virtual SALOMEDSClient_Study* Open(const std::string& theStudyUrl); - virtual void Close( SALOMEDSClient_Study* theStudy); - virtual void Save( SALOMEDSClient_Study* theStudy, bool theMultiFile); - virtual void SaveASCII( SALOMEDSClient_Study* theStudy, bool theMultiFile); - virtual void SaveAs(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile); - virtual void SaveAsASCII(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile); + virtual _PTR(Study) NewStudy(const std::string& study_name); + virtual _PTR(Study) Open(const std::string& theStudyUrl); + virtual void Close(const _PTR(Study)& theStudy); + virtual void Save(const _PTR(Study)& theStudy, bool theMultiFile); + virtual void SaveASCII(const _PTR(Study)& theStudy, bool theMultiFile); + virtual void SaveAs(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile); + virtual void SaveAsASCII(const std::string& theUrl, const _PTR(Study)& theStudy, bool theMultiFile); virtual std::vector GetOpenStudies(); - virtual SALOMEDSClient_Study* GetStudyByName(const std::string& theStudyName) ; - virtual SALOMEDSClient_Study* GetStudyByID(int theStudyID) ; - virtual bool CanCopy(SALOMEDSClient_SObject* theSO); - virtual bool Copy(SALOMEDSClient_SObject* theSO); - virtual bool CanPaste(SALOMEDSClient_SObject* theSO); - virtual SALOMEDSClient_SObject* Paste(SALOMEDSClient_SObject* theSO); + virtual _PTR(Study) GetStudyByName(const std::string& theStudyName) ; + virtual _PTR(Study) GetStudyByID(int theStudyID) ; + virtual bool CanCopy(const _PTR(SObject)& theSO); + virtual bool Copy(const _PTR(SObject)& theSO); + virtual bool CanPaste(const _PTR(SObject)& theSO); + virtual _PTR(SObject) Paste(const _PTR(SObject)& theSO); private: void init_orb(); diff --git a/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx b/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx index f0b10efd9..47e37fc0e 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseBuilder.cxx @@ -32,48 +32,48 @@ SALOMEDS_UseCaseBuilder::~SALOMEDS_UseCaseBuilder() if(!_isLocal) _corba_impl->Destroy(); } -bool SALOMEDS_UseCaseBuilder::Append(SALOMEDSClient_SObject* theObject) +bool SALOMEDS_UseCaseBuilder::Append(const _PTR(SObject)& theObject) { bool ret; - SALOMEDS_SObject* obj = dynamic_cast(theObject); + SALOMEDS_SObject* obj = dynamic_cast(theObject.get()); if(_isLocal) ret = _local_impl->Append(obj->GetLocalImpl()); else ret = _corba_impl->Append(obj->GetCORBAImpl()); return ret; } -bool SALOMEDS_UseCaseBuilder::Remove(SALOMEDSClient_SObject* theObject) +bool SALOMEDS_UseCaseBuilder::Remove(const _PTR(SObject)& theObject) { bool ret; - SALOMEDS_SObject* obj = dynamic_cast(theObject); + SALOMEDS_SObject* obj = dynamic_cast(theObject.get()); if(_isLocal) ret = _local_impl->Remove(obj->GetLocalImpl()); else ret = _corba_impl->Remove(obj->GetCORBAImpl()); return ret; } -bool SALOMEDS_UseCaseBuilder::AppendTo(SALOMEDSClient_SObject* theFather, SALOMEDSClient_SObject* theObject) +bool SALOMEDS_UseCaseBuilder::AppendTo(const _PTR(SObject)& theFather, _PTR(SObject) theObject) { bool ret; - SALOMEDS_SObject* father = dynamic_cast(theFather); - SALOMEDS_SObject* obj = dynamic_cast(theObject); + SALOMEDS_SObject* father = dynamic_cast(theFather.get()); + SALOMEDS_SObject* obj = dynamic_cast(theObject.get()); if(_isLocal) ret = _local_impl->AppendTo(father->GetLocalImpl(), obj->GetLocalImpl()); else ret = _corba_impl->AppendTo(father->GetCORBAImpl(), obj->GetCORBAImpl()); return ret; } -bool SALOMEDS_UseCaseBuilder::InsertBefore(SALOMEDSClient_SObject* theFirst, SALOMEDSClient_SObject* theNext) +bool SALOMEDS_UseCaseBuilder::InsertBefore(const _PTR(SObject)& theFirst, _PTR(SObject) theNext) { bool ret; - SALOMEDS_SObject* first = dynamic_cast(theFirst); - SALOMEDS_SObject* next = dynamic_cast(theNext); + SALOMEDS_SObject* first = dynamic_cast(theFirst.get()); + SALOMEDS_SObject* next = dynamic_cast(theNext.get()); if(_isLocal) ret = _local_impl->InsertBefore(first->GetLocalImpl(), next->GetLocalImpl()); else ret = _corba_impl->InsertBefore(first->GetCORBAImpl(), next->GetCORBAImpl()); return ret; } -bool SALOMEDS_UseCaseBuilder::SetCurrentObject(SALOMEDSClient_SObject* theObject) +bool SALOMEDS_UseCaseBuilder::SetCurrentObject(const _PTR(SObject)& theObject) { bool ret; - SALOMEDS_SObject* obj = dynamic_cast(theObject); + SALOMEDS_SObject* obj = dynamic_cast(theObject.get()); if(_isLocal) ret = _local_impl->SetCurrentObject(obj->GetLocalImpl()); else ret = _corba_impl->SetCurrentObject(obj->GetCORBAImpl()); return ret; @@ -87,19 +87,19 @@ bool SALOMEDS_UseCaseBuilder::SetRootCurrent() return ret; } -bool SALOMEDS_UseCaseBuilder::HasChildren(SALOMEDSClient_SObject* theObject) +bool SALOMEDS_UseCaseBuilder::HasChildren(const _PTR(SObject)& theObject) { bool ret; - SALOMEDS_SObject* obj = dynamic_cast(theObject); + SALOMEDS_SObject* obj = dynamic_cast(theObject.get()); if(_isLocal) ret = _local_impl->HasChildren(obj->GetLocalImpl()); else ret = _corba_impl->HasChildren(obj->GetCORBAImpl()); return ret; } -bool SALOMEDS_UseCaseBuilder::IsUseCase(SALOMEDSClient_SObject* theObject) +bool SALOMEDS_UseCaseBuilder::IsUseCase(const _PTR(SObject)& theObject) { bool ret; - SALOMEDS_SObject* obj = dynamic_cast(theObject); + SALOMEDS_SObject* obj = dynamic_cast(theObject.get()); if(_isLocal) ret = _local_impl->IsUseCase(obj->GetLocalImpl()); else ret = _corba_impl->IsUseCase(obj->GetCORBAImpl()); return ret; @@ -113,12 +113,12 @@ bool SALOMEDS_UseCaseBuilder::SetName(const std::string& theName) return ret; } -SALOMEDSClient_SObject* SALOMEDS_UseCaseBuilder::GetCurrentObject() +_PTR(SObject) SALOMEDS_UseCaseBuilder::GetCurrentObject() { SALOMEDS_SObject* obj = NULL; if(_isLocal) obj = new SALOMEDS_SObject(_local_impl->GetCurrentObject()); else obj = new SALOMEDS_SObject(_corba_impl->GetCurrentObject()); - return obj; + return _PTR(SObject)(obj); } std::string SALOMEDS_UseCaseBuilder::GetName() @@ -129,19 +129,19 @@ std::string SALOMEDS_UseCaseBuilder::GetName() return aName; } -SALOMEDSClient_SObject* SALOMEDS_UseCaseBuilder::AddUseCase(const std::string& theName) +_PTR(SObject) SALOMEDS_UseCaseBuilder::AddUseCase(const std::string& theName) { SALOMEDS_SObject* obj = NULL; if(_isLocal) obj = new SALOMEDS_SObject(_local_impl->AddUseCase((char*)theName.c_str())); else obj = new SALOMEDS_SObject(_corba_impl->AddUseCase((char*)theName.c_str())); - return obj; + return _PTR(SObject)(obj); } -SALOMEDSClient_UseCaseIterator* SALOMEDS_UseCaseBuilder::GetUseCaseIterator(SALOMEDSClient_SObject* theObject) +_PTR(UseCaseIterator) SALOMEDS_UseCaseBuilder::GetUseCaseIterator(const _PTR(SObject)& theObject) { SALOMEDS_UseCaseIterator* it = NULL; - SALOMEDS_SObject* obj = dynamic_cast(theObject); + SALOMEDS_SObject* obj = dynamic_cast(theObject.get()); if(_isLocal) it = new SALOMEDS_UseCaseIterator(_local_impl->GetUseCaseIterator(obj->GetLocalImpl())); else it = new SALOMEDS_UseCaseIterator(_corba_impl->GetUseCaseIterator(obj->GetCORBAImpl())); - return it; + return _PTR(UseCaseIterator)(it); } diff --git a/src/SALOMEDS/SALOMEDS_UseCaseBuilder.hxx b/src/SALOMEDS/SALOMEDS_UseCaseBuilder.hxx index 9d7eabb55..2907267a6 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseBuilder.hxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseBuilder.hxx @@ -5,9 +5,7 @@ #ifndef __SALOMEDS_USECaseBuilder_H__ #define __SALOMEDS_USECaseBuilder_H__ -#include "SALOMEDSClient_UseCaseIterator.hxx" -#include "SALOMEDSClient_UseCaseBuilder.hxx" -#include "SALOMEDSClient_SObject.hxx" +#include "SALOMEDSClient.hxx" #include "SALOMEDSImpl_UseCaseBuilder.hxx" // IDL headers @@ -28,19 +26,19 @@ public: SALOMEDS_UseCaseBuilder(SALOMEDS::UseCaseBuilder_ptr theBuilder); ~SALOMEDS_UseCaseBuilder(); - virtual bool Append(SALOMEDSClient_SObject* theObject); - virtual bool Remove(SALOMEDSClient_SObject* theObject); - virtual bool AppendTo(SALOMEDSClient_SObject* theFather, SALOMEDSClient_SObject* theObject); - virtual bool InsertBefore(SALOMEDSClient_SObject* theFirst, SALOMEDSClient_SObject* theNext); - virtual bool SetCurrentObject(SALOMEDSClient_SObject* theObject); + virtual bool Append(const _PTR(SObject)& theObject); + virtual bool Remove(const _PTR(SObject)& theObject); + virtual bool AppendTo(const _PTR(SObject)& theFather, _PTR(SObject) theObject); + virtual bool InsertBefore(const _PTR(SObject)& theFirst, _PTR(SObject) theNext); + virtual bool SetCurrentObject(const _PTR(SObject)& theObject); virtual bool SetRootCurrent(); - virtual bool HasChildren(SALOMEDSClient_SObject* theObject); - virtual bool IsUseCase(SALOMEDSClient_SObject* theObject); + virtual bool HasChildren(const _PTR(SObject)& theObject); + virtual bool IsUseCase(const _PTR(SObject)& theObject); virtual bool SetName(const std::string& theName); - virtual SALOMEDSClient_SObject* GetCurrentObject(); + virtual _PTR(SObject) GetCurrentObject(); virtual std::string GetName(); - virtual SALOMEDSClient_SObject* AddUseCase(const std::string& theName); - virtual SALOMEDSClient_UseCaseIterator* GetUseCaseIterator(SALOMEDSClient_SObject* anObject); + virtual _PTR(SObject) AddUseCase(const std::string& theName); + virtual _PTR(UseCaseIterator) GetUseCaseIterator(const _PTR(SObject)& anObject); }; #endif diff --git a/src/SALOMEDS/SALOMEDS_UseCaseIterator.cxx b/src/SALOMEDS/SALOMEDS_UseCaseIterator.cxx index 293f34fbc..a027f6c18 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseIterator.cxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseIterator.cxx @@ -46,10 +46,10 @@ void SALOMEDS_UseCaseIterator::Next() else _corba_impl->Next(); } -SALOMEDSClient_SObject* SALOMEDS_UseCaseIterator::Value() +_PTR(SObject) SALOMEDS_UseCaseIterator::Value() { SALOMEDS_SObject* aSO; if(_isLocal) aSO = new SALOMEDS_SObject(_local_impl->Value()); else aSO = new SALOMEDS_SObject(_corba_impl->Value()); - return aSO; + return _PTR(SObject)(aSO); } diff --git a/src/SALOMEDS/SALOMEDS_UseCaseIterator.hxx b/src/SALOMEDS/SALOMEDS_UseCaseIterator.hxx index 35533515a..687ba85fb 100644 --- a/src/SALOMEDS/SALOMEDS_UseCaseIterator.hxx +++ b/src/SALOMEDS/SALOMEDS_UseCaseIterator.hxx @@ -29,7 +29,7 @@ public: virtual void Init(bool theAllLevels); virtual bool More(); virtual void Next(); - virtual SALOMEDSClient_SObject* Value(); + virtual _PTR(SObject) Value(); }; #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient.hxx b/src/SALOMEDSClient/SALOMEDSClient.hxx index 3c7ce7118..e64da148c 100644 --- a/src/SALOMEDSClient/SALOMEDSClient.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient.hxx @@ -1,5 +1,5 @@ #ifndef SALOMEDSCLIENT_HXX -#define SALOMEDSCLIENT_HXX +#define SALOMEDSCLIENT_HXX #include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_AttributeComment.hxx" diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeComment.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeComment.hxx index 12f31a6fb..2f01b00c7 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeComment.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeComment.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributeComment_HeaderFile #define SALOMEDSClient_AttributeComment_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeDrawable.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeDrawable.hxx index c00cb0c7d..b5d424af8 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeDrawable.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeDrawable.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributeDrawable_HeaderFile #define SALOMEDSClient_AttributeDrawable_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeDrawable: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeExpandable.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeExpandable.hxx index 0da2e37e1..e16aa10cd 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeExpandable.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeExpandable.hxx @@ -6,6 +6,7 @@ #ifndef SALOMEDSClient_AttributeExpandable_HeaderFile #define SALOMEDSClient_AttributeExpandable_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeExpandable: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeExternalFileDef.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeExternalFileDef.hxx index 556e0090a..c2b6bba76 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeExternalFileDef.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeExternalFileDef.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributeExternalFileDef_HeaderFile #define SALOMEDSClient_AttributeExternalFileDef_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeFileType.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeFileType.hxx index 0091fdce5..cc2077398 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeFileType.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeFileType.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributeFileType_HeaderFile #define SALOMEDSClient_AttributeFileType_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeFlags.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeFlags.hxx index 99f314d33..712fd2f0d 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeFlags.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeFlags.hxx @@ -6,6 +6,7 @@ #ifndef SALOMEDSClient_AttributeFlags_HeaderFile #define SALOMEDSClient_AttributeFlags_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeFlags: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeGraphic.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeGraphic.hxx index 0a494c77f..3de00de92 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeGraphic.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeGraphic.hxx @@ -6,6 +6,7 @@ #ifndef SALOMEDSClient_AttributeGraphic_HeaderFile #define SALOMEDSClient_AttributeGraphic_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeGraphic: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeIOR.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeIOR.hxx index fbf652334..920f97f30 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeIOR.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeIOR.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributeIOR_HeaderFile #define SALOMEDSClient_AttributeIOR_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeInteger.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeInteger.hxx index 25c7a20fa..1b177df19 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeInteger.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeInteger.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributeInteger_HeaderFile #define SALOMEDSClient_AttributeInteger_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeInteger: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeLocalID.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeLocalID.hxx index 51c1a2a33..705b490c7 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeLocalID.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeLocalID.hxx @@ -6,6 +6,7 @@ #ifndef SALOMEDSClient_AttributeLocalID_HeaderFile #define SALOMEDSClient_AttributeLocalID_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeLocalID: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeName.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeName.hxx index 0195617ff..1d19e84c5 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeName.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeName.hxx @@ -6,6 +6,7 @@ #ifndef SALOMEDSClient_AttributeName_HeaderFile #define SALOMEDSClient_AttributeName_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeOpened.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeOpened.hxx index 76d641adc..fb9266d99 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeOpened.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeOpened.hxx @@ -6,6 +6,7 @@ #ifndef SALOMEDSClient_AttributeOpened_HeaderFile #define SALOMEDSClient_AttributeOpened_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeOpened: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributePersistentRef.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributePersistentRef.hxx index c4fb218a8..6efa09cdc 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributePersistentRef.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributePersistentRef.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributePersistentRef_HeaderFile #define SALOMEDSClient_AttributePersistentRef_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributePixMap.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributePixMap.hxx index dfb9718e6..530380ea2 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributePixMap.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributePixMap.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributePixMap_HeaderFile #define SALOMEDSClient_AttributePixMap_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributePythonObject.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributePythonObject.hxx index de067d3eb..ee0318bcd 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributePythonObject.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributePythonObject.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributePythonObject_HeaderFile #define SALOMEDSClient_AttributePythonObject_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeReal.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeReal.hxx index ec5007bc2..e5360aa2b 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeReal.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeReal.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributeReal_HeaderFile #define SALOMEDSClient_AttributeReal_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeReal: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeSelectable.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeSelectable.hxx index 39eb766b4..257860e51 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeSelectable.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeSelectable.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributeSelectable_HeaderFile #define SALOMEDSClient_AttributeSelectable_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeSelectable: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeSequenceOfInteger.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeSequenceOfInteger.hxx index a0f065a71..4fbd4587d 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeSequenceOfInteger.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeSequenceOfInteger.hxx @@ -6,6 +6,7 @@ #define SALOMEDSClient_AttributeSequenceOfInteger_HeaderFile #include +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeSequenceOfInteger: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeSequenceOfReal.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeSequenceOfReal.hxx index d4578d29c..e30df3bde 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeSequenceOfReal.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeSequenceOfReal.hxx @@ -6,6 +6,7 @@ #define SALOMEDSClient_AttributeSequenceOfSequenceOfReal_HeaderFile #include +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeSequenceOfReal: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx index ed76b8cba..db7c35d36 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeStudyProperties.hxx @@ -7,7 +7,7 @@ #include #include - +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeStudyProperties: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfInteger.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfInteger.hxx index f15ea6be3..2bdeb301c 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfInteger.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfInteger.hxx @@ -7,6 +7,7 @@ #include #include +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeTableOfInteger: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfReal.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfReal.hxx index 774998260..22df706c4 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfReal.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfReal.hxx @@ -7,6 +7,7 @@ #include #include +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeTableOfReal: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfString.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfString.hxx index 040e8df2c..ddb7b69da 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfString.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeTableOfString.hxx @@ -7,6 +7,7 @@ #include #include +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeTableOfString: public virtual SALOMEDSClient_GenericAttribute diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeTarget.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeTarget.hxx index 323dc6404..bb221ed5c 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeTarget.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeTarget.hxx @@ -6,15 +6,16 @@ #define SALOMEDSClient_AttributeTarget_HeaderFile #include +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_SObject.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeTarget: public virtual SALOMEDSClient_GenericAttribute { public: - virtual void Add(SALOMEDSClient_SObject* theObject) = 0; - virtual std::vector Get() = 0; - virtual void Remove(SALOMEDSClient_SObject* theObject) = 0; + virtual void Add(const _PTR(SObject)& theObject) = 0; + virtual std::vector<_PTR(SObject)> Get() = 0; + virtual void Remove(const _PTR(SObject)& theObject) = 0; }; #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeTextColor.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeTextColor.hxx index fb5f65dcb..84f722cc0 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeTextColor.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeTextColor.hxx @@ -6,6 +6,7 @@ #define SALOMEDSClient_AttributeTextColor_HeaderFile #include +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include "SALOMEDSClient_definitions.hxx" diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeTextHighlightColor.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeTextHighlightColor.hxx index 1102ea355..ecc03a7ab 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeTextHighlightColor.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeTextHighlightColor.hxx @@ -6,6 +6,7 @@ #define SALOMEDSClient_AttributeTextHighlightColor_HeaderFile #include +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include "SALOMEDSClient_definitions.hxx" diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeTreeNode.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeTreeNode.hxx index 949f11ab7..8cfe7715b 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeTreeNode.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeTreeNode.hxx @@ -5,36 +5,37 @@ #ifndef SALOMEDSClient_AttributeTreeNode_HeaderFile #define SALOMEDSClient_AttributeTreeNode_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" class SALOMEDSClient_AttributeTreeNode { public: - virtual void SetFather(SALOMEDSClient_AttributeTreeNode* value) = 0; + virtual void SetFather(const _PTR(AttributeTreeNode)& value) = 0; virtual bool HasFather() = 0; - virtual SALOMEDSClient_AttributeTreeNode* GetFather() = 0; - virtual void SetPrevious(SALOMEDSClient_AttributeTreeNode* value) = 0; + virtual _PTR(AttributeTreeNode) GetFather() = 0; + virtual void SetPrevious(const _PTR(AttributeTreeNode)& value) = 0; virtual bool HasPrevious() = 0; - virtual SALOMEDSClient_AttributeTreeNode* GetPrevious() = 0; - virtual void SetNext(SALOMEDSClient_AttributeTreeNode* value) = 0; + virtual _PTR(AttributeTreeNode) GetPrevious() = 0; + virtual void SetNext(const _PTR(AttributeTreeNode)& value) = 0; virtual bool HasNext() = 0; - virtual SALOMEDSClient_AttributeTreeNode* GetNext() = 0; - virtual void SetFirst(SALOMEDSClient_AttributeTreeNode* value) = 0; + virtual _PTR(AttributeTreeNode) GetNext() = 0; + virtual void SetFirst(const _PTR(AttributeTreeNode)& value) = 0; virtual bool HasFirst() = 0; - virtual SALOMEDSClient_AttributeTreeNode* GetFirst() = 0; + virtual _PTR(AttributeTreeNode) GetFirst() = 0; virtual void SetTreeID(const std::string& value) = 0; virtual std::string GetTreeID() = 0; - virtual void Append(SALOMEDSClient_AttributeTreeNode* value) = 0; - virtual void Prepend(SALOMEDSClient_AttributeTreeNode* value) = 0; - virtual void InsertBefore(SALOMEDSClient_AttributeTreeNode* value) = 0; - virtual void InsertAfter(SALOMEDSClient_AttributeTreeNode* value) = 0; + virtual void Append(const _PTR(AttributeTreeNode)& value) = 0; + virtual void Prepend(const _PTR(AttributeTreeNode)& value) = 0; + virtual void InsertBefore(const _PTR(AttributeTreeNode)& value) = 0; + virtual void InsertAfter(const _PTR(AttributeTreeNode)& value) = 0; virtual void Remove() = 0; virtual int Depth() = 0; virtual bool IsRoot() = 0; - virtual bool IsDescendant(SALOMEDSClient_AttributeTreeNode* value) = 0; - virtual bool IsFather(SALOMEDSClient_AttributeTreeNode* value) = 0; - virtual bool IsChild(SALOMEDSClient_AttributeTreeNode* value) = 0; + virtual bool IsDescendant(const _PTR(AttributeTreeNode)& value) = 0; + virtual bool IsFather(const _PTR(AttributeTreeNode)& value) = 0; + virtual bool IsChild(const _PTR(AttributeTreeNode)& value) = 0; virtual std::string Label() = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_AttributeUserID.hxx b/src/SALOMEDSClient/SALOMEDSClient_AttributeUserID.hxx index 22a5056c3..6e9007065 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_AttributeUserID.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_AttributeUserID.hxx @@ -5,6 +5,7 @@ #ifndef SALOMEDSClient_AttributeUserID_HeaderFile #define SALOMEDSClient_AttributeUserID_HeaderFile +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" #include diff --git a/src/SALOMEDSClient/SALOMEDSClient_ChildIterator.hxx b/src/SALOMEDSClient/SALOMEDSClient_ChildIterator.hxx index 5cb0ee231..6fa372013 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_ChildIterator.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_ChildIterator.hxx @@ -5,6 +5,7 @@ #ifndef __SALOMEDSClient_CHILDITERATOR_H__ #define __SALOMEDSClient_CHILDITERATOR_H__ +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_SObject.hxx" class SALOMEDSClient_ChildIterator @@ -16,6 +17,6 @@ public: virtual void InitEx(bool) = 0; virtual bool More() = 0; virtual void Next() = 0; - virtual SALOMEDSClient_SObject* Value() = 0; + virtual _PTR(SObject) Value() = 0; }; #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_GenericAttribute.hxx b/src/SALOMEDSClient/SALOMEDSClient_GenericAttribute.hxx index 1f25d5784..4d1f23482 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_GenericAttribute.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_GenericAttribute.hxx @@ -6,7 +6,7 @@ #define _GENERICCLIENT_ATTRIBUTE_HXX_ #include - +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_SObject.hxx" class SALOMEDSClient_GenericAttribute @@ -17,7 +17,7 @@ public: virtual void CheckLocked() = 0; virtual std::string Type() = 0; virtual std::string GetClassType() = 0; - virtual SALOMEDSClient_SObject* GetSObject() = 0; + virtual _PTR(SObject) GetSObject() = 0; }; #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_SComponent.hxx b/src/SALOMEDSClient/SALOMEDSClient_SComponent.hxx index a8f0c4915..dc2a5c054 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_SComponent.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_SComponent.hxx @@ -5,6 +5,7 @@ #ifndef __SALOMEDSCLIENT_SCOMPONENT_H__ #define __SALOMEDSCLIENT_SCOMPONENT_H__ +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_SObject.hxx" #include diff --git a/src/SALOMEDSClient/SALOMEDSClient_SComponentIterator.hxx b/src/SALOMEDSClient/SALOMEDSClient_SComponentIterator.hxx index bcba46c40..40cd3cec6 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_SComponentIterator.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_SComponentIterator.hxx @@ -5,6 +5,7 @@ #ifndef __SALOMEDSClient_SCOMPONENTITERATOR_H__ #define __SALOMEDSClient_SCOMPONENTITERATOR_H__ +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_SComponent.hxx" class SALOMEDSClient_SComponentIterator @@ -15,6 +16,7 @@ public: virtual void Init() = 0; virtual bool More() = 0; virtual void Next() = 0; - virtual SALOMEDSClient_SComponent* Value() = 0; + virtual _PTR(SComponent) Value() = 0; }; + #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_SObject.hxx b/src/SALOMEDSClient/SALOMEDSClient_SObject.hxx index d682b8395..7bc4e7af6 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_SObject.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_SObject.hxx @@ -9,6 +9,8 @@ #include #include +#include "SALOMEDSClient_definitions.hxx" + class SALOMEDSClient_Study; class SALOMEDSClient_SComponent; class SALOMEDSClient_GenericAttribute; @@ -19,19 +21,20 @@ public: virtual ~SALOMEDSClient_SObject() {} virtual std::string GetID() = 0; - virtual SALOMEDSClient_SComponent* GetFatherComponent() = 0; - virtual SALOMEDSClient_SObject* GetFather() = 0; - virtual bool FindAttribute(SALOMEDSClient_GenericAttribute*& anAttribute, const std::string& aTypeOfAttribute) = 0; - virtual bool ReferencedObject(SALOMEDSClient_SObject*& theObject) = 0; - virtual bool FindSubObject(int theTag, SALOMEDSClient_SObject*& theObject) = 0; - virtual SALOMEDSClient_Study* GetStudy() = 0; + virtual _PTR(SComponent) GetFatherComponent() = 0; + virtual _PTR(SObject) GetFather() = 0; + virtual bool FindAttribute(_PTR(GenericAttribute)& anAttribute, const std::string& aTypeOfAttribute) = 0; + virtual bool ReferencedObject(_PTR(SObject)& theObject) = 0; + virtual bool FindSubObject(int theTag, _PTR(SObject)& theObject) = 0; + virtual _PTR(Study) GetStudy() = 0; virtual std::string Name() = 0; virtual void Name(const std::string& theName) = 0; - virtual std::vector GetAllAttributes() = 0; + virtual std::vector<_PTR(GenericAttribute)> GetAllAttributes() = 0; virtual std::string GetName() = 0; virtual std::string GetComment() = 0; virtual std::string GetIOR() = 0; virtual int Tag() = 0; virtual int Depth() = 0; }; + #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_Study.hxx b/src/SALOMEDSClient/SALOMEDSClient_Study.hxx index 0d83ca69f..2140d3322 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_Study.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_Study.hxx @@ -8,6 +8,7 @@ #include #include +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_SComponentIterator.hxx" #include "SALOMEDSClient_StudyBuilder.hxx" #include "SALOMEDSClient_SObject.hxx" @@ -25,24 +26,24 @@ public: virtual std::string GetPersistentReference() = 0; virtual std::string GetTransientReference() = 0; virtual bool IsEmpty() = 0; - virtual SALOMEDSClient_SComponent* FindComponent (const std::string& aComponentName) = 0; - virtual SALOMEDSClient_SComponent* FindComponentID(const std::string& aComponentID) = 0; - virtual SALOMEDSClient_SObject* FindObject(const std::string& anObjectName) = 0; - virtual std::vector FindObjectByName( const std::string& anObjectName, const std::string& aComponentName ) = 0; - virtual SALOMEDSClient_SObject* FindObjectID(const std::string& anObjectID) = 0; - virtual SALOMEDSClient_SObject* CreateObjectID(const std::string& anObjectID) = 0; - virtual SALOMEDSClient_SObject* FindObjectIOR(const std::string& anObjectIOR) = 0; - virtual SALOMEDSClient_SObject* FindObjectByPath(const std::string& thePath) = 0; - virtual std::string GetObjectPath(SALOMEDSClient_SObject* theSO) = 0; + virtual _PTR(SComponent) FindComponent (const std::string& aComponentName) = 0; + virtual _PTR(SComponent) FindComponentID(const std::string& aComponentID) = 0; + virtual _PTR(SObject) FindObject(const std::string& anObjectName) = 0; + virtual std::vector<_PTR(SObject)> FindObjectByName( const std::string& anObjectName, const std::string& aComponentName ) = 0; + virtual _PTR(SObject) FindObjectID(const std::string& anObjectID) = 0; + virtual _PTR(SObject) CreateObjectID(const std::string& anObjectID) = 0; + virtual _PTR(SObject) FindObjectIOR(const std::string& anObjectIOR) = 0; + virtual _PTR(SObject) FindObjectByPath(const std::string& thePath) = 0; + virtual std::string GetObjectPath(const _PTR(SObject)& theSO) = 0; virtual void SetContext(const std::string& thePath) = 0; virtual std::string GetContext() = 0; virtual std::vector GetObjectNames(const std::string& theContext) = 0; virtual std::vector GetDirectoryNames(const std::string& theContext) = 0; virtual std::vector GetFileNames(const std::string& theContext) = 0; virtual std::vector GetComponentNames(const std::string& theContext) = 0; - virtual SALOMEDSClient_ChildIterator* NewChildIterator(SALOMEDSClient_SObject* theSO) = 0; - virtual SALOMEDSClient_SComponentIterator* NewComponentIterator() = 0; - virtual SALOMEDSClient_StudyBuilder* NewBuilder() = 0; + virtual _PTR(ChildIterator) NewChildIterator(const _PTR(SObject)& theSO) = 0; + virtual _PTR(SComponentIterator) NewComponentIterator() = 0; + virtual _PTR(StudyBuilder) NewBuilder() = 0; virtual std::string Name() = 0; virtual void Name(const std::string& name) = 0; virtual bool IsSaved() = 0; @@ -52,13 +53,15 @@ public: virtual void URL(const std::string& url) = 0; virtual int StudyId() = 0; virtual void StudyId(int id) = 0; - virtual std::vector FindDependances(SALOMEDSClient_SObject* theSO) = 0; - virtual SALOMEDSClient_AttributeStudyProperties* GetProperties() = 0; + virtual std::vector<_PTR(SObject)> FindDependances(const _PTR(SObject)& theSO) = 0; + virtual _PTR(AttributeStudyProperties) GetProperties() = 0; virtual std::string GetLastModificationDate() = 0; virtual std::vector GetModificationsDate() = 0; - virtual SALOMEDSClient_UseCaseBuilder* GetUseCaseBuilder() = 0; + virtual _PTR(UseCaseBuilder) GetUseCaseBuilder() = 0; virtual void Close() = 0; virtual void EnableUseCaseAutoFilling(bool isEnabled) = 0; virtual bool DumpStudy(const std::string& thePath, const std::string& theBaseName, bool isPublished) = 0; }; + + #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx b/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx index 7c9026f0a..9066fb451 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_StudyBuilder.hxx @@ -5,6 +5,7 @@ #ifndef __SALOMEDSClient_STUDYBUILDER_H__ #define __SALOMEDSClient_STUDYBUILDER_H__ +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_SObject.hxx" #include "SALOMEDSClient_SComponent.hxx" #include "SALOMEDSClient_GenericAttribute.hxx" @@ -15,25 +16,25 @@ class SALOMEDSClient_StudyBuilder public: virtual ~SALOMEDSClient_StudyBuilder() {} - virtual SALOMEDSClient_SComponent* NewComponent(const std::string& ComponentDataType) = 0; - virtual void DefineComponentInstance (SALOMEDSClient_SComponent*, const std::string& ComponentIOR) = 0; - virtual void RemoveComponent(SALOMEDSClient_SComponent* theSCO) = 0; - virtual SALOMEDSClient_SObject* NewObject(SALOMEDSClient_SObject* theFatherObject) = 0; - virtual SALOMEDSClient_SObject* NewObjectToTag(SALOMEDSClient_SObject* theFatherObject, int theTag) = 0; + virtual _PTR(SComponent) NewComponent(const std::string& ComponentDataType) = 0; + virtual void DefineComponentInstance (const _PTR(SComponent)&, const std::string& ComponentIOR) = 0; + virtual void RemoveComponent(const _PTR(SComponent)& theSCO) = 0; + virtual _PTR(SObject) NewObject(const _PTR(SObject)& theFatherObject) = 0; + virtual _PTR(SObject) NewObjectToTag(const _PTR(SObject)& theFatherObject, int theTag) = 0; virtual void AddDirectory(const std::string& thePath) = 0; - virtual void LoadWith(SALOMEDSClient_SComponent* theSCO, const std::string& theIOR) = 0; - virtual void Load(SALOMEDSClient_SObject* theSCO) = 0; - virtual void RemoveObject(SALOMEDSClient_SObject* theSO) = 0; - virtual void RemoveObjectWithChildren(SALOMEDSClient_SObject* theSO) = 0; - virtual SALOMEDSClient_GenericAttribute* FindOrCreateAttribute(SALOMEDSClient_SObject* theSO, const std::string& aTypeOfAttribute) = 0; - virtual bool FindAttribute(SALOMEDSClient_SObject* theSO, - SALOMEDSClient_GenericAttribute* theAttribute, + virtual void LoadWith(const _PTR(SComponent)& theSCO, const std::string& theIOR) = 0; + virtual void Load(const _PTR(SObject)& theSCO) = 0; + virtual void RemoveObject(const _PTR(SObject)& theSO) = 0; + virtual void RemoveObjectWithChildren(const _PTR(SObject)& theSO) = 0; + virtual _PTR(GenericAttribute) FindOrCreateAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute) = 0; + virtual bool FindAttribute(const _PTR(SObject)& theSO, + _PTR(GenericAttribute)& theAttribute, const std::string& aTypeOfAttribute) = 0; - virtual void RemoveAttribute(SALOMEDSClient_SObject* theSO, const std::string& aTypeOfAttribute) = 0; - virtual void Addreference(SALOMEDSClient_SObject* me, SALOMEDSClient_SObject* thereferencedObject) = 0; - virtual void RemoveReference(SALOMEDSClient_SObject* me) = 0; - virtual void SetGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID) = 0; - virtual bool IsGUID(SALOMEDSClient_SObject* theSO, const std::string& theGUID) = 0; + virtual void RemoveAttribute(const _PTR(SObject)& theSO, const std::string& aTypeOfAttribute) = 0; + virtual void Addreference(const _PTR(SObject)& me, const _PTR(SObject)& thereferencedObject) = 0; + virtual void RemoveReference(const _PTR(SObject)& me) = 0; + virtual void SetGUID(const _PTR(SObject)& theSO, const std::string& theGUID) = 0; + virtual bool IsGUID(const _PTR(SObject)& theSO, const std::string& theGUID) = 0; virtual void NewCommand() = 0; virtual void CommitCommand()= 0; virtual bool HasOpenCommand() = 0; @@ -44,8 +45,9 @@ public: virtual bool GetAvailableRedos() = 0; virtual int UndoLimit() = 0; virtual void UndoLimit(int theLimit) = 0; - virtual void SetName(SALOMEDSClient_SObject* theSO, const std::string& theValue) = 0; - virtual void SetComment(SALOMEDSClient_SObject* theSO, const std::string& theValue) = 0; - virtual void SetIOR(SALOMEDSClient_SObject* theSO, const std::string& theValue) = 0; + virtual void SetName(const _PTR(SObject)& theSO, const std::string& theValue) = 0; + virtual void SetComment(const _PTR(SObject)& theSO, const std::string& theValue) = 0; + virtual void SetIOR(const _PTR(SObject)& theSO, const std::string& theValue) = 0; }; + #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx b/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx index 25c5403a5..212264fd0 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_StudyManager.hxx @@ -8,6 +8,7 @@ #include #include +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_Study.hxx" class SALOMEDSClient_StudyManager @@ -15,20 +16,20 @@ class SALOMEDSClient_StudyManager public: virtual ~SALOMEDSClient_StudyManager() {} - virtual SALOMEDSClient_Study* NewStudy(const std::string& study_name) = 0; - virtual SALOMEDSClient_Study* Open(const std::string& theStudyUrl) = 0; - virtual void Close( SALOMEDSClient_Study* theStudy) = 0; - virtual void Save( SALOMEDSClient_Study* theStudy, bool theMultiFile) = 0; - virtual void SaveASCII( SALOMEDSClient_Study* theStudy, bool theMultiFile) = 0; - virtual void SaveAs(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) = 0; - virtual void SaveAsASCII(const std::string& theUrl, SALOMEDSClient_Study* theStudy, bool theMultiFile) = 0; + virtual _PTR(Study) NewStudy(const std::string& study_name) = 0; + virtual _PTR(Study) Open(const std::string& theStudyUrl) = 0; + virtual void Close( _PTR(Study) theStudy) = 0; + virtual void Save( _PTR(Study) theStudy, bool theMultiFile) = 0; + virtual void SaveASCII( _PTR(Study) theStudy, bool theMultiFile) = 0; + virtual void SaveAs(const std::string& theUrl, _PTR(Study) theStudy, bool theMultiFile) = 0; + virtual void SaveAsASCII(const std::string& theUrl, _PTR(Study) theStudy, bool theMultiFile) = 0; virtual std::vector GetOpenStudies() = 0; - virtual SALOMEDSClient_Study* GetStudyByName(const std::string& theStudyName) = 0; - virtual SALOMEDSClient_Study* GetStudyByID(int theStudyID) = 0; - virtual bool CanCopy(SALOMEDSClient_SObject* theSO) = 0; - virtual bool Copy(SALOMEDSClient_SObject* theSO) = 0; - virtual bool CanPaste(SALOMEDSClient_SObject* theSO) = 0; - virtual SALOMEDSClient_SObject* Paste(SALOMEDSClient_SObject* theSO) = 0; + virtual _PTR(Study) GetStudyByName(const std::string& theStudyName) = 0; + virtual _PTR(Study) GetStudyByID(int theStudyID) = 0; + virtual bool CanCopy(const _PTR(SObject)& theSO) = 0; + virtual bool Copy(const _PTR(SObject)& theSO) = 0; + virtual bool CanPaste(const _PTR(SObject)& theSO) = 0; + virtual _PTR(SObject) Paste(const _PTR(SObject)& theSO) = 0; }; diff --git a/src/SALOMEDSClient/SALOMEDSClient_UseCaseBuilder.hxx b/src/SALOMEDSClient/SALOMEDSClient_UseCaseBuilder.hxx index 81212d0e9..e535f06cb 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_UseCaseBuilder.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_UseCaseBuilder.hxx @@ -5,28 +5,31 @@ #ifndef __SALOMEDSClient_USECaseBuilder_H__ #define __SALOMEDSClient_USECaseBuilder_H__ +#include +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_UseCaseIterator.hxx" #include "SALOMEDSClient_SObject.hxx" -#include class SALOMEDSClient_UseCaseBuilder { public: virtual ~SALOMEDSClient_UseCaseBuilder() {} - virtual bool Append(SALOMEDSClient_SObject* theObject) = 0; - virtual bool Remove(SALOMEDSClient_SObject* theObject) = 0; - virtual bool AppendTo(SALOMEDSClient_SObject* theFather, SALOMEDSClient_SObject* theObject) = 0; - virtual bool InsertBefore(SALOMEDSClient_SObject* theFirst, SALOMEDSClient_SObject* theNext) = 0; - virtual bool SetCurrentObject(SALOMEDSClient_SObject* theObject) = 0; + virtual bool Append(const _PTR(SObject)& theObject) = 0; + virtual bool Remove(const _PTR(SObject)& theObject) = 0; + virtual bool AppendTo(const _PTR(SObject)& theFather, _PTR(SObject) theObject) = 0; + virtual bool InsertBefore(const _PTR(SObject)& theFirst, _PTR(SObject) theNext) = 0; + virtual bool SetCurrentObject(const _PTR(SObject)& theObject) = 0; virtual bool SetRootCurrent() = 0; - virtual bool HasChildren(SALOMEDSClient_SObject* theObject) = 0; - virtual bool IsUseCase(SALOMEDSClient_SObject* theObject) = 0; + virtual bool HasChildren(const _PTR(SObject)& theObject) = 0; + virtual bool IsUseCase(const _PTR(SObject)& theObject) = 0; virtual bool SetName(const std::string& theName) = 0; - virtual SALOMEDSClient_SObject* GetCurrentObject() = 0; + virtual _PTR(SObject) GetCurrentObject() = 0; virtual std::string GetName() = 0; - virtual SALOMEDSClient_SObject* AddUseCase(const std::string& theName) = 0; - virtual SALOMEDSClient_UseCaseIterator* GetUseCaseIterator(SALOMEDSClient_SObject* anObject) = 0; + virtual _PTR(SObject) AddUseCase(const std::string& theName) = 0; + virtual _PTR(UseCaseIterator) GetUseCaseIterator(const _PTR(SObject)& anObject) = 0; }; + + #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_UseCaseIterator.hxx b/src/SALOMEDSClient/SALOMEDSClient_UseCaseIterator.hxx index d3c1df8b5..41376b52b 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_UseCaseIterator.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_UseCaseIterator.hxx @@ -5,6 +5,7 @@ #ifndef __SALOMEDSClient_USECASEITERATOR_H__ #define __SALOMEDSClient_USECASEITERATOR_H__ +#include "SALOMEDSClient_definitions.hxx" #include "SALOMEDSClient_SObject.hxx" class SALOMEDSClient_UseCaseIterator @@ -16,6 +17,7 @@ public: virtual void Init(bool) = 0; virtual bool More() = 0; virtual void Next() = 0; - virtual SALOMEDSClient_SObject* Value() = 0; + virtual _PTR(SObject) Value() = 0; }; + #endif diff --git a/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx b/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx index dd6f8992a..4407b501b 100644 --- a/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx +++ b/src/SALOMEDSClient/SALOMEDSClient_definitions.hxx @@ -1,5 +1,44 @@ #ifndef SALOMEDSCLIENT_DEF_HXX -#define SALOMEDSCLIENT_DEF_HXX +#define SALOMEDSCLIENT_DEF_HXX + +#include + +template class shared_ptr: public boost::shared_ptr +{ +public: + shared_ptr() {} + + template + explicit shared_ptr(Y * p) + { + reset(p); + } + + template + shared_ptr(shared_ptr const & r): + boost::shared_ptr(r,boost::detail::dynamic_cast_tag()) + {} + + template + shared_ptr & operator=(shared_ptr const & r) + { + shared_ptr(r).swap(*this); + return *this; + } + + template shared_ptr& operator()(Y * p) // Y must be complete + { + if(T* pt = dynamic_cast(p)) + boost::shared_ptr::reset(pt); + else + boost::throw_exception(std::bad_cast()); + return *this; + } + +}; + +#define _PTR(Class) shared_ptr +#define _CAST(Class, shared_ptr_Obj) dynamic_cast(shared_ptr_Obj.get()) struct STextColor { -- 2.39.2