0022904: Clean up sccsid variables
[occt.git] / src / Expr / Expr_UnknownIterator.cxx
CommitLineData
7fd59977 1// Copyright: Matra-Datavision 1991
2// File: Expr_UnknownIterator.cxx
3// Created: Wed Sep 18 11:21:49 1991
4// Author: Arnaud BOUZY
5// <adn>
6
7#include <Expr_UnknownIterator.ixx>
8#include <Standard_NoMoreObject.hxx>
9#include <Standard_NoSuchObject.hxx>
10#include <Expr.hxx>
11
12Expr_UnknownIterator::Expr_UnknownIterator (const Handle(Expr_GeneralExpression)& exp)
13{
14 Perform(exp);
15 myCurrent = 1;
16}
17
18void Expr_UnknownIterator::Perform(const Handle(Expr_GeneralExpression)& exp)
19{
20 if (exp->IsKind(STANDARD_TYPE(Expr_NamedUnknown))) {
21 Handle(Expr_NamedUnknown) varexp = Handle(Expr_NamedUnknown)::DownCast(exp);
22 if (!myMap.Contains(varexp)) {
23 myMap.Add(varexp);
24 }
25 }
26 Standard_Integer nbsub = exp->NbSubExpressions();
27 for (Standard_Integer i = 1; i <= nbsub ; i++) {
28 Perform(exp->SubExpression(i));
29 }
30}
31
32Standard_Boolean Expr_UnknownIterator::More() const
33{
34 return (myCurrent <= myMap.Extent());
35}
36
37void Expr_UnknownIterator::Next ()
38{
39 if (!More()) {
40 Standard_NoMoreObject::Raise();
41 }
42 myCurrent++;
43}
44
45Handle(Expr_NamedUnknown) Expr_UnknownIterator::Value () const
46{
47 return myMap(myCurrent);
48}
49