Make attribute iterator work with pointers to attributes, so, creation of handle on each iteration is avoided.
Standard_EXPORT void Next() ;
inline Handle(TDF_Attribute) Value() const;
+ //! Provides an access to the internal pointer of the current attribute.
+ //! The method has better performance as not-creating handle.
+ inline const TDF_Attribute* PtrValue() const { return myValue; }
protected:
if (IsNull()) throw Standard_NullObject("A null Label has no attribute.");
TDF_AttributeIterator itr (myLabelNode); // Without removed attributes.
for ( ; itr.More(); itr.Next()) {
- if (itr.Value()->ID() == anID) {
- anAttribute = itr.Value();
+ if (itr.PtrValue()->ID() == anID) {
+ anAttribute = itr.PtrValue();
return Standard_True;
}
}
template <class T>
Standard_Boolean FindAttribute (const Standard_GUID& theID, Handle(T)& theAttr) const
{
- Handle(TDF_Attribute) anAttr = theAttr;
+ Handle(TDF_Attribute) anAttr;
return FindAttribute (theID, anAttr) && ! (theAttr = Handle(T)::DownCast(anAttr)).IsNull();
}