7fd59977 |
1 | -- File: IFSelect_ContextWrite.cdl |
2 | -- Created: Fri Jan 26 13:20:13 1996 |
3 | -- Author: Christian CAILLET |
4 | -- <cky@fidox> |
5 | ---Copyright: Matra Datavision 1996 |
6 | |
7 | |
8 | class ContextWrite from IFSelect |
9 | |
10 | ---Purpose : This class gathers various informations used by File Modifiers |
11 | -- apart from the writer object, which is specific of the norm |
12 | -- and of the physical format |
13 | -- |
14 | -- These informations are controlled by an object AppliedModifiers |
15 | -- (if it is not defined, no modification is allowed on writing) |
16 | -- |
17 | -- Furthermore, in return, ContextModif can record Checks, either |
18 | -- one for all, or one for each Entity. It supports trace too. |
19 | |
20 | uses Transient, CString, AsciiString from TCollection, |
21 | InterfaceModel, EntityIterator, Graph, HGraph, |
22 | Protocol from Interface, Check, CheckIterator, GeneralModifier, |
23 | AppliedModifiers |
24 | |
25 | raises NoSuchObject |
26 | |
27 | is |
28 | |
29 | Create (model : InterfaceModel; proto : Protocol; |
30 | applieds : mutable AppliedModifiers; filename : CString) |
31 | returns ContextWrite; |
32 | ---Purpose : Prepares a ContextWrite with these informations : |
33 | -- - the model which is to be written |
34 | -- - the protocol to be used |
35 | -- - the filename |
36 | -- - an object AppliedModifiers to work. It gives a list of |
37 | -- FileModifiers to be ran, and for each one it can give |
38 | -- a restricted list of entities (in the model), else all |
39 | -- the model is considered |
40 | |
41 | Create (hgraph : HGraph; proto : Protocol; |
42 | applieds : mutable AppliedModifiers; filename : CString) |
43 | returns ContextWrite; |
44 | ---Purpose : Same as above but with an already computed Graph |
45 | |
46 | Model (me) returns InterfaceModel; |
47 | ---Purpose : Returns the Model |
48 | |
49 | Protocol (me) returns Protocol; |
50 | ---Purpose : Returns the Protocol; |
51 | |
52 | FileName (me) returns CString; |
53 | ---Purpose : Returns the File Name |
54 | |
55 | AppliedModifiers (me) returns mutable AppliedModifiers; |
56 | ---Purpose : Returns the object AppliedModifiers |
57 | |
58 | Graph (me : in out) returns Graph; |
59 | ---Purpose : Returns the Graph, either given when created, else created |
60 | -- the first time it is queried |
61 | ---C++ : return const & |
62 | |
63 | |
64 | -- -- Control when running -- -- |
65 | |
66 | NbModifiers (me) returns Integer; |
67 | ---Purpose : Returns the count of recorded File Modifiers |
68 | |
69 | SetModifier (me : in out; numod : Integer) returns Boolean; |
70 | ---Purpose : Sets active the File Modifier n0 <numod> |
71 | -- Then, it prepares the list of entities to consider, if any |
72 | -- Returns False if <numod> out of range |
73 | |
74 | FileModifier (me) returns mutable GeneralModifier; |
75 | ---Purpose : Returns the currently active File Modifier. Cast to be done |
76 | -- Null if not properly set : must be test IsNull after casting |
77 | |
78 | IsForNone (me) returns Boolean; |
79 | ---Purpose : Returns True if no modifier is currently set |
80 | |
81 | IsForAll (me) returns Boolean; |
82 | ---Purpose : Returns True if the current modifier is to be applied to |
83 | -- the whole model. Else, a restricted list of selected entities |
84 | -- is defined, it can be exploited by the File Modifier |
85 | |
86 | NbEntities (me) returns Integer; |
87 | ---Purpose : Returns the total count of selected entities |
88 | |
89 | Start (me : in out); |
90 | ---Purpose : Starts an iteration on selected items. It takes into account |
91 | -- IsForAll/IsForNone, by really iterating on all selected items. |
92 | |
93 | More (me) returns Boolean; |
94 | ---Purpose : Returns True until the iteration has finished |
95 | |
96 | Next (me : in out); |
97 | ---Purpose : Advances the iteration |
98 | |
99 | Value (me) returns Transient raises NoSuchObject; |
100 | ---Purpose : Returns the current selected entity in the model |
101 | |
102 | |
103 | -- -- Trace and Check -- -- |
104 | |
105 | AddCheck (me : in out; check : Check) is static; |
106 | ---Purpose : Adds a Check to the CheckList. If it is empty, nothing is done |
107 | -- If it concerns an Entity from the Model (by SetEntity) |
108 | -- to which another Check is attached, it is merged to it. |
109 | -- Else, it is added or merged as to GlobalCheck. |
110 | |
111 | AddWarning (me : in out; start : Transient; mess : CString; orig : CString = ""); |
112 | ---Purpose : Adds a Warning Message for an Entity from the Model |
113 | -- If <start> is not an Entity from the model (e.g. the |
114 | -- model itself) this message is added to Global Check. |
115 | |
116 | AddFail (me : in out; start : Transient; mess : CString; orig : CString = ""); |
117 | ---Purpose : Adds a Fail Message for an Entity from the Model |
118 | -- If <start> is not an Entity from the model (e.g. the |
119 | -- model itself) this message is added to Global Check. |
120 | |
121 | CCheck (me : in out; num : Integer = 0) returns Check; |
122 | ---Purpose : Returns a Check given an Entity number (in the Model) |
123 | -- by default a Global Check. Creates it the first time. |
124 | -- It can then be acknowledged on the spot, in condition that the |
125 | -- caller works by reference ("Interface_Check& check = ...") |
126 | |
127 | CCheck (me : in out; start : Transient) returns Check; |
128 | ---Purpose : Returns a Check attached to an Entity from the Model |
129 | -- It can then be acknowledged on the spot, in condition that the |
130 | -- caller works by reference ("Interface_Check& check = ...") |
131 | |
132 | CheckList (me) returns CheckIterator is static; |
133 | ---Purpose : Returns the complete CheckList |
134 | |
135 | fields |
136 | |
137 | themodel : InterfaceModel; |
138 | theproto : Protocol; |
139 | thefile : AsciiString; |
140 | theapply : AppliedModifiers; |
141 | thehgraf : HGraph; |
142 | thecheck : CheckIterator; |
143 | thenumod : Integer; |
144 | thenbent : Integer; |
145 | thecurr : Integer; |
146 | themodif : GeneralModifier; |
147 | |
148 | end ContextWrite; |