0024002: Overall code and build procedure refactoring -- automatic
[occt.git] / src / TDataStd / TDataStd_ChildNodeIterator.hxx
1 // Created on: 2000-01-26
2 // Created by: Denis PASCAL
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _TDataStd_ChildNodeIterator_HeaderFile
17 #define _TDataStd_ChildNodeIterator_HeaderFile
18
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
22
23 #include <Standard_Integer.hxx>
24 #include <Standard_Boolean.hxx>
25 class TDataStd_TreeNode;
26
27
28 //! Iterates on the  ChildStepren step of  a step, at the
29 //! first level  only.   It  is possible  to ask  the
30 //! iterator to explore all the sub step levels of the
31 //! given one, with the option "allLevels".
32 class TDataStd_ChildNodeIterator 
33 {
34 public:
35
36   DEFINE_STANDARD_ALLOC
37
38   
39   //! Creates an empty iterator.
40   Standard_EXPORT TDataStd_ChildNodeIterator();
41   
42   //! Iterates on the ChildStepren of the given Step. If
43   //! <allLevels> option is set to true, it explores not
44   //! only the first, but all the sub Step levels.
45   Standard_EXPORT TDataStd_ChildNodeIterator(const Handle(TDataStd_TreeNode)& aTreeNode, const Standard_Boolean allLevels = Standard_False);
46   
47   //! Initializes the iteration on  the Children Step of
48   //! the  given Step. If <allLevels>  option is  set to
49   //! true, it explores not  only the first, but all the
50   //! sub Step levels.
51   Standard_EXPORT void Initialize (const Handle(TDataStd_TreeNode)& aTreeNode, const Standard_Boolean allLevels = Standard_False);
52   
53   //! Returns True if there is a current Item in the
54   //! iteration.
55     Standard_Boolean More() const;
56   
57   //! Move to the next Item
58   Standard_EXPORT void Next();
59   
60   //! Move to the next Brother. If there is none, go up
61   //! etc. This method is interesting only with
62   //! "allLevels" behavior, because it avoids to explore
63   //! the current Step ChildStepren.
64   Standard_EXPORT void NextBrother();
65   
66   //! Returns the current item; a null Step if there is
67   //! no one.
68     const Handle(TDataStd_TreeNode)& Value() const;
69
70
71
72
73 protected:
74
75
76
77
78
79 private:
80
81
82
83   Handle(TDataStd_TreeNode) myNode;
84   Standard_Integer myFirstLevel;
85
86
87 };
88
89
90 #include <TDataStd_ChildNodeIterator.lxx>
91
92
93
94
95
96 #endif // _TDataStd_ChildNodeIterator_HeaderFile