7fd59977 |
1 | //static const char* sccsid = "@(#)Expr_RUIterator.cxx 3.2 95/01/10"; // Do not delete this line. Used by sccs. |
2 | // Copyright: Matra-Datavision 1991 |
3 | // File: Expr_RUIterator.cxx |
4 | // Created: Thu Jun 13 17:17:50 1991 |
5 | // Author: Arnaud BOUZY |
6 | // <adn> |
7 | |
8 | #include <Expr_RUIterator.ixx> |
9 | #include <Standard_NoMoreObject.hxx> |
10 | #include <Standard_NoSuchObject.hxx> |
11 | #include <Expr_RelationIterator.hxx> |
12 | #include <Expr_UnknownIterator.hxx> |
13 | #include <Expr_SingleRelation.hxx> |
14 | #include <Expr.hxx> |
15 | |
16 | Expr_RUIterator::Expr_RUIterator (const Handle(Expr_GeneralRelation)& rel) |
17 | { |
18 | Expr_RelationIterator ri(rel); |
19 | Handle(Expr_SingleRelation) srel; |
20 | Handle(Expr_NamedUnknown) var; |
21 | myCurrent =1; |
22 | while (ri.More()) { |
23 | srel = ri.Value(); |
24 | ri.Next(); |
25 | Expr_UnknownIterator ui1(srel->FirstMember()); |
26 | while (ui1.More()) { |
27 | var = ui1.Value(); |
28 | ui1.Next(); |
29 | if (!myMap.Contains(var)) { |
30 | myMap.Add(var); |
31 | } |
32 | } |
33 | Expr_UnknownIterator ui2(srel->SecondMember()); |
34 | while (ui2.More()) { |
35 | var = ui2.Value(); |
36 | ui2.Next(); |
37 | if (!myMap.Contains(var)) { |
38 | myMap.Add(var); |
39 | } |
40 | } |
41 | } |
42 | } |
43 | |
44 | Standard_Boolean Expr_RUIterator::More () const |
45 | { |
46 | return (myCurrent <= myMap.Extent()); |
47 | } |
48 | |
49 | void Expr_RUIterator::Next () |
50 | { |
51 | if (!More()) { |
52 | Standard_NoMoreObject::Raise(); |
53 | } |
54 | myCurrent++; |
55 | } |
56 | |
57 | Handle(Expr_NamedUnknown) Expr_RUIterator::Value () const |
58 | { |
59 | return myMap(myCurrent); |
60 | } |
61 | |