0028852: TDF_AttributeIterator should not be marked as "handle with care"
[occt.git] / src / TDF / TDF_AttributeIterator.hxx
CommitLineData
b311480e 1// Created by: DAUTRY Philippe
2// Copyright (c) 1998-1999 Matra Datavision
973c2be1 3// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 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
973c2be1 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
7fd59977 16// -------------------------
7fd59977 17
18// Version: 0.0
b311480e 19//Version Date Purpose
7fd59977 20// 0.0 Feb 16 1998 Creation
21
7fd59977 22#ifndef TDF_AttributeIterator_HeaderFile
23#define TDF_AttributeIterator_HeaderFile
24
cb389a77 25#include <TDF_Attribute.hxx>
ebc93ae7 26#include <TDF_Label.hxx>
7fd59977 27#include <TDF_LabelNodePtr.hxx>
7fd59977 28
29// This class provides a way to iterates on the
30// up-to-date (current) valid attributes of a label.
31//
c1a688e9 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,
38// etc.
39//
40// Even a forgotten attribute may be found if this
7fd59977 41// option is set. To use this possibility, look at
42// the constructor.
7fd59977 43
44class TDF_AttributeIterator {
45
46public:
47
48 // Methods PUBLIC
49 //
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 TDF_Attribute * Value() const;
63
64
65protected:
66
67 // Methods PROTECTED
68 //
69
70
71 // Fields PROTECTED
72 //
73
74
75private:
76
77 // Methods PRIVATE
78 //
79 void goToNext (const Handle(TDF_Attribute)& anAttr);
80
81
82 // Fields PRIVATE
83 //
84 TDF_Attribute * myValue;
85 Standard_Boolean myWithoutForgotten;
86};
87
88
89// other inline functions and methods (like "C++: function call" methods)
90//
91
92inline Standard_Boolean TDF_AttributeIterator::More() const
93{ return (myValue != 0L); }
94
95inline TDF_Attribute * TDF_AttributeIterator::Value() const
96{ return myValue; }
97
98#endif