1 // Created by: DAUTRY Philippe
2 // Copyright (c) 1998-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 // -------------------------
19 //Version Date Purpose
20 // 0.0 Feb 16 1998 Creation
22 #ifndef TDF_AttributeIterator_HeaderFile
23 #define TDF_AttributeIterator_HeaderFile
25 #include <TDF_Attribute.hxx>
26 #include <TDF_Label.hxx>
27 #include <TDF_LabelNodePtr.hxx>
29 // This class provides a way to iterates on the
30 // up-to-date (current) valid attributes of a label.
32 // This class should not be used for standard attributes workflow.
33 // Application allways knows what to search at particular label.
34 // So, use IsAttribute and FindAttibute methods of
35 // TDF_Label to check and get attributes in usual way.
36 // This class may be used for processing of content of labels
37 // in generic way, like copy-tool, specific save/restore algorithms,
40 // Even a forgotten attribute may be found if this
41 // option is set. To use this possibility, look at
44 class TDF_AttributeIterator {
50 Standard_EXPORT TDF_AttributeIterator();
51 Standard_EXPORT TDF_AttributeIterator
52 (const TDF_Label& aLabel,
53 const Standard_Boolean withoutForgotten = Standard_True);
54 Standard_EXPORT TDF_AttributeIterator
55 (const TDF_LabelNodePtr aLabelNode,
56 const Standard_Boolean withoutForgotten = Standard_True);
57 Standard_EXPORT void Initialize
58 (const TDF_Label& aLabel,
59 const Standard_Boolean withoutForgotten = Standard_True) ;
60 inline Standard_Boolean More() const;
61 Standard_EXPORT void Next() ;
62 inline Handle(TDF_Attribute) Value() const;
64 //! Provides an access to the internal pointer of the current attribute.
65 //! The method has better performance as not-creating handle.
66 inline const TDF_Attribute* PtrValue() const { return myValue; }
82 void goToNext (const Handle(TDF_Attribute)& anAttr);
87 TDF_Attribute * myValue;
88 Standard_Boolean myWithoutForgotten;
92 // other inline functions and methods (like "C++: function call" methods)
95 inline Standard_Boolean TDF_AttributeIterator::More() const
96 { return (myValue != 0L); }
98 inline Handle(TDF_Attribute) TDF_AttributeIterator::Value() const