From fe4f17f018eeee651fa2b785ced154e15dfe0070 Mon Sep 17 00:00:00 2001 From: mpv Date: Mon, 26 Jun 2017 15:41:09 +0300 Subject: [PATCH] 0028853: TDF_AttributeIterator should give handles instead of pointers Make "Value" method of the iterator return Handle (instead of pointer) to unify public interfaces. --- src/TDF/TDF_AttributeIterator.hxx | 4 ++-- src/TDF/TDF_Data.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TDF/TDF_AttributeIterator.hxx b/src/TDF/TDF_AttributeIterator.hxx index 4a1c831e17..fa8622c583 100644 --- a/src/TDF/TDF_AttributeIterator.hxx +++ b/src/TDF/TDF_AttributeIterator.hxx @@ -59,7 +59,7 @@ public: const Standard_Boolean withoutForgotten = Standard_True) ; inline Standard_Boolean More() const; Standard_EXPORT void Next() ; - inline TDF_Attribute * Value() const; + inline Handle(TDF_Attribute) Value() const; protected: @@ -92,7 +92,7 @@ private: inline Standard_Boolean TDF_AttributeIterator::More() const { return (myValue != 0L); } -inline TDF_Attribute * TDF_AttributeIterator::Value() const +inline Handle(TDF_Attribute) TDF_AttributeIterator::Value() const { return myValue; } #endif diff --git a/src/TDF/TDF_Data.cxx b/src/TDF/TDF_Data.cxx index e9f232bac6..9920c7338e 100644 --- a/src/TDF/TDF_Data.cxx +++ b/src/TDF/TDF_Data.cxx @@ -216,7 +216,7 @@ Standard_Integer TDF_Data::CommitTransaction TDF_AttributeIterator itr1(aLabel, Standard_False); while (itr1.More()) { - TDF_Attribute * aPtrCurrentAtt = itr1.Value(); + Handle(TDF_Attribute) aPtrCurrentAtt = itr1.Value(); itr1.Next(); // currentAtt = itr1.Value(); @@ -297,7 +297,7 @@ Standard_Integer TDF_Data::CommitTransaction } // --------------------------------------------------------- Modified. else { - const TDF_Attribute* anAttrPtr = aPtrCurrentAtt; // to avoid ambiguity + const TDF_Attribute* anAttrPtr = aPtrCurrentAtt.operator->(); // to avoid ambiguity TDF_Data_DeltaCreation ("Modification", anAttrPtr->DeltaOnModification(backupAtt));