b311480e |
1 | -- Created on: 1992-08-24 |
2 | -- Created by: Ramin BARRETO |
3 | -- Copyright (c) 1992-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
8 | -- This library is free software; you can redistribute it and/or modify it under |
9 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | -- by the Free Software Foundation, with special exception defined in the file |
11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | -- distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class AncestorIterator from Standard |
18 | ---Purpose: |
19 | -- The class <AncestorIterator> is a iterator which provides |
20 | -- information about inheritance. |
21 | -- An AncestorIterator object is used to scan sequentially the |
22 | -- hierarchy of a type object from its direct super-type to the root. |
23 | -- |
24 | -- Warning: |
25 | -- The near parents are first. |
26 | -- |
27 | uses |
28 | Boolean from Standard |
29 | ,Integer from Standard |
30 | ,Type from Standard |
31 | |
32 | raises |
33 | NoMoreObject from Standard |
34 | |
35 | is |
36 | |
37 | ------------------------------------------------------------------------ |
38 | ---Category: The Constructur of AncestorIterator. |
39 | ------------------------------------------------------------------------ |
40 | Create(anOther: AncestorIterator ) returns AncestorIterator; |
41 | ---Purpose: |
42 | -- The copy constructor for a AncestorIterator . |
43 | -- |
44 | ---Level: Advanced |
45 | |
46 | Create(aType: Type) returns AncestorIterator; |
47 | ---Purpose: |
48 | -- Creates an iterator on the type <aType>. |
49 | -- Set the iterator at the beginning of the ancestors; |
50 | -- this means near parents are first. |
51 | ---Level: Advanced |
52 | |
53 | ------------------------------------------------------------------------ |
54 | ---Category: Assignation. |
55 | ------------------------------------------------------------------------ |
56 | Assign(me: in out; anOther: AncestorIterator); |
57 | ---Purpose: |
58 | -- Assigns an AncestorIterator from another AncestorIterator. |
59 | -- |
60 | ---C++: alias operator = |
61 | ---Level: Advanced |
62 | |
63 | ------------------------------------------------------------------------ |
64 | ---Category: The methods for iterating. |
65 | ------------------------------------------------------------------------ |
66 | |
67 | More(me) returns Boolean; |
68 | ---Purpose: |
69 | -- Returns True if there are other ancestors. |
70 | -- |
71 | -- Example: |
72 | -- |
73 | -- Handle(Standard_Type) type; |
74 | -- Standard_AncestorIterator super(TYPE(Geom_Circle)); |
75 | -- while(super.More()) { type = super.Value(); |
76 | -- super.Next(); |
77 | -- } |
78 | |
79 | Next(me: in out) |
80 | ---Purpose: |
81 | -- Moves the position of the iterator to the next super-type. |
82 | -- If the current position corresponds to a root class, it becomes undefined. |
83 | -- |
84 | -- Exceptions: |
85 | -- Standard_NoMoreObject if the position of the iterator is undefined |
86 | raises NoMoreObject; -- If there are no more ancestors. |
87 | ---Level: Advanced |
88 | |
89 | ------------------------------------------------------------------------ |
90 | ---Category: The information of each ancestor. |
91 | ------------------------------------------------------------------------ |
92 | |
93 | Iterator(me) returns AncestorIterator |
94 | ---Purpose: |
95 | -- Returns an <AncestorIterator> corresponding to the current position |
96 | -- of the iterator. |
97 | raises NoMoreObject; -- If there are no more Ancestors. |
98 | ---Level: Advanced |
99 | |
100 | Value(me) returns Type |
101 | ---Purpose: |
102 | -- Returns the type corresponding to the current position of |
103 | -- the iterator. |
104 | -- |
105 | -- Example: |
106 | -- |
107 | -- Standard_AncestorIterator super(TYPE(Geom_Circle)); |
108 | -- assert (super.Value() == TYPE(Geom_Conic)); |
109 | -- |
110 | -- Exceptions: |
111 | -- Standard_NoSuchObject if the position of the iterator is undefined. |
112 | raises NoMoreObject; -- If there are no more ancestors. |
113 | |
114 | fields |
115 | |
116 | myType : Type; |
117 | myNbIter: Integer; |
118 | |
119 | end AncestorIterator from Standard; |