b311480e |
1 | -- Created on: 2008-01-22 |
2 | -- Created by: Vladislav ROMASHKO |
3 | -- Copyright (c) 2008-2012 OPEN CASCADE SAS |
4 | -- |
5 | -- The content of this file is subject to the Open CASCADE Technology Public |
6 | -- License Version 6.5 (the "License"). You may not use the content of this file |
7 | -- except in compliance with the License. Please obtain a copy of the License |
8 | -- at http://www.opencascade.org and read it completely before using this file. |
9 | -- |
10 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | -- |
13 | -- The Original Code and all software distributed under the License is |
14 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | -- Initial Developer hereby disclaims all such warranties, including without |
16 | -- limitation, any warranties of merchantability, fitness for a particular |
17 | -- purpose or non-infringement. Please see the License for the specific terms |
18 | -- and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | |
21 | class Iterator from TFunction |
22 | |
23 | ---Purpose: Iterator of the graph of functions |
24 | |
25 | uses |
26 | |
27 | Label from TDF, |
28 | GUID from Standard, |
29 | LabelList from TDF, |
30 | LabelMap from TDF, |
31 | ExecutionStatus from TFunction, |
32 | Scope from TFunction |
33 | |
34 | is |
35 | |
36 | Create |
37 | ---Purpose: An empty constructor. |
38 | returns Iterator from TFunction; |
39 | |
40 | Create (Access : Label from TDF) |
41 | ---Purpose: A constructor. |
42 | -- Initializes the iterator. |
43 | returns Iterator from TFunction; |
44 | |
45 | Init (me : in out; |
46 | Access : Label from TDF) |
47 | ---Purpose: Initializes the Iterator. |
48 | is virtual; |
49 | |
50 | SetUsageOfExecutionStatus (me : in out; |
51 | usage : Boolean from Standard); |
52 | ---Purpose: Defines the mode of iteration - usage or not of the execution status. |
53 | -- If the iterator takes into account the execution status, |
54 | -- the method ::Current() returns only "not executed" functions |
55 | -- while their status is not changed. |
56 | -- If the iterator ignores the execution status, |
57 | -- the method ::Current() returns the functions |
58 | -- following their dependencies and ignoring the execution status. |
59 | |
60 | GetUsageOfExecutionStatus (me) |
61 | ---Purpose: Returns usage of execution status by the iterator. |
62 | returns Boolean from Standard; |
63 | |
64 | GetMaxNbThreads (me) |
65 | ---Purpose: Analyses the graph of dependencies and returns |
66 | -- maximum number of threads may be used to calculate the model. |
67 | returns Integer from Standard |
68 | is virtual; |
69 | |
70 | Current (me) |
71 | ---Purpose: Returns the current list of functions. |
72 | -- If the iterator uses the execution status, |
73 | -- the returned list contains only the functions |
74 | -- with "not executed" status. |
75 | ---C++: return const & |
76 | returns LabelList from TDF |
77 | is virtual; |
78 | |
79 | More (me) |
80 | ---Purpose: Returns false if the graph of functions is fully iterated. |
81 | returns Boolean from Standard |
82 | is virtual; |
83 | |
84 | Next (me : in out) |
85 | ---Purpose: Switches the iterator to the next list of current functions. |
86 | is virtual; |
87 | |
88 | GetStatus (me; |
89 | func : Label from TDF) |
90 | ---Purpose: A help-function aimed to help the user to check the status of retrurned function. |
91 | -- It calls TFunction_GraphNode::GetStatus() inside. |
92 | returns ExecutionStatus from TFunction; |
93 | |
94 | SetStatus (me; |
95 | func : Label from TDF; |
96 | status : ExecutionStatus from TFunction); |
97 | ---Purpose: A help-function aimed to help the user to change the execution status of a function. |
98 | -- It calls TFunction_GraphNode::SetStatus() inside. |
99 | |
100 | Dump (me; |
101 | OS : in out OStream from Standard) |
102 | ---C++: return & |
103 | returns OStream from Standard; |
104 | |
105 | fields |
106 | |
107 | myCurrent : LabelList from TDF; |
108 | myUsageOfExecutionStatus : Boolean from Standard; |
109 | myPassedFunctions : LabelMap from TDF; -- an internal field. |
110 | myScope : Scope from TFunction; -- an internal field. |
111 | |
112 | end Iterator; |