0022627: Change OCCT memory management defaults
[occt.git] / src / IFSelect / IFSelect_ShareOut.cdl
CommitLineData
7fd59977 1-- File: ShareOut.cdl
2-- Created: Tue Nov 17 15:48:30 1992
3-- Author: Christian CAILLET
4-- <cky@topsn2>
5---Copyright: Matra Datavision 1992
6
7
8class ShareOut from IFSelect inherits TShared
9
10 ---Purpose : This class gathers the informations required to produce one or
11 -- several file(s) from the content of an InterfaceModel (passing
12 -- through the creation of intermediate Models).
13 --
14 -- It can correspond to a complete Divide up of a set of Entities
15 -- intended to be exhaustive and to limit duplications. Or to a
16 -- simple Extraction of some Entities, in order to work on them.
17 --
18 -- A ShareOut is composed of a list of Dispatches.
19 -- To Each Dispatch in the ShareOut, is bound an Id. Number
20 -- This Id. Number allows to identify a Display inside the
21 -- ShareOut in a stable way (for instance, to attach file names)
22 --
23 -- ShareOut can be seen as a "passive" description, activated
24 -- through a ShareOutResult, which gives the InterfaceModel on
25 -- which to work, as a unique source. Thus it is easy to change
26 -- it without coherence problems
27 --
28 -- Services about it are provided by the class ShareOutResult
29 -- which is a service class : simulation (list of files and of
30 -- entities per file; "forgotten" entities; duplicated entities),
31 -- exploitation (generation of derivated Models, each of them
32 -- generating an output file)
33
34uses SequenceOfInteger from TColStd, CString,
35 HAsciiString from TCollection, AsciiString from TCollection,
36 Dispatch, TSeqOfDispatch,
37 GeneralModifier, Modifier, SequenceOfGeneralModifier
38
39raises InterfaceError, OutOfRange
40
41is
42
43 Create returns mutable ShareOut;
44 ---Purpose : Creates an empty ShareOut
45
46 Clear (me : mutable; onlydisp : Boolean);
47 ---Purpose : Removes in one operation all the Dispatches with their Idents
48 -- Also clears all informations about Names, and all Results but
49 -- naming informations which are :
50 -- - kept if <onlydisp> is True.
51 -- - cleared if <onlydisp> is False (complete clearing)
52 -- If <onlydisp> is True, that's all. Else, clears also Modifiers
53
54 ClearResult (me : mutable; alsoname : Boolean);
55 ---Purpose : Clears all data produced (apart from Dispatches, etc...)
56 -- if <alsoname> is True, all is cleared. Else, informations
57 -- about produced Names are kept (to maintain unicity of naming
58 -- across clearings)
59
60 RemoveItem (me : mutable; item : Transient) returns Boolean;
61 ---Purpose : Removes an item, which can be, either a Dispatch (removed from
62 -- the list of Dispatches), or a GeneralModifier (removed from
63 -- the list of Model Modifiers or from the list of File Modifiers
64 -- according to its type).
65 -- Returns True if done, False if has not been found or if it is
66 -- neither a Dispatch, nor a Modifier.
67
68
69 LastRun (me) returns Integer;
70 ---Purpose : Returns the rank of last run item (ClearResult resets it to 0)
71
72 SetLastRun (me : mutable; last : Integer);
73 ---Purpose : Records a new alue for the rank of last run item
74
75 NbDispatches (me) returns Integer;
76 ---Purpose : Returns the count of Dispatches
77
78 DispatchRank (me; disp : Dispatch) returns Integer;
79 ---Purpose : Returns the Rank of a Dispatch, given its Value (Handle).
80 -- Returns 0 if the Dispatch is unknown in the ShareOut
81
82 Dispatch (me; num : Integer) returns mutable Dispatch
83 ---Purpose : Returns a Dispatch, given its rank in the list
84 raises OutOfRange;
85 -- Error if <num> is out of range
86 ---C++ : return const &
87
88 AddDispatch (me : mutable; disp : mutable Dispatch)
89 ---Purpose : Adds a Dispatch to the list
90 raises InterfaceError;
91 -- Error if the Dispatch is attached to a ShareOut other than "me"
92
93 RemoveDispatch (me : mutable; rank : Integer) returns Boolean;
94 ---Purpose : Removes a Dispatch, given its rank in the list
95 -- Returns True if done, False if rank is not between
96 -- (LastRun + 1) and (NbDispatches)
97
98 -- -- Modifiers to be applied -- --
99
100 AddModifier (me : mutable; modifier : mutable GeneralModifier;
101 atnum : Integer);
102 ---Purpose : Sets a Modifier to be applied on all Dispatches to be run
103 -- If <modifier> is a ModelModifier, adds it to the list of
104 -- Model Modifiers; else to the list of File Modifiers
105 -- By default (atnum = 0) at the end of the list, else at <atnum>
106 -- Each Modifier is used, after each copy of a packet of Entities
107 -- into a Model : its criteria are checked and if they are OK,
108 -- the method Perform of this Modifier is run.
109
110 AddModifier (me : mutable; modifier : mutable GeneralModifier;
111 dispnum : Integer; atnum : Integer);
112 ---Purpose : Sets a Modifier to be applied on the Dispatch <dispnum>
113 -- If <modifier> is a ModelModifier, adds it to the list of
114 -- Model Modifiers; else to the list of File Modifiers
115 -- This is the same list as for all Dispatches, but the
116 -- Modifier is qualified to be applied to one Dispatch only
117 -- Then, <atnum> refers to the entire list
118 -- By default (atnum = 0) at the end of the list, else at <atnum>
119 -- Remark : if the Modifier was already in the list and if
120 -- <atnum> = 0, the Modifier is not moved, but only qualified
121 -- for a Dispatch
122
123
124 AddModif (me : mutable; modifier : mutable GeneralModifier;
125 formodel : Boolean; atnum : Integer = 0);
126 ---Purpose : Adds a Modifier to the list of Modifiers : Model Modifiers if
127 -- <formodel> is True, File Modifiers else (internal).
128
129 NbModifiers (me; formodel : Boolean) returns Integer;
130 ---Purpose : Returns count of Modifiers (which apply to complete Models) :
131 -- Model Modifiers if <formodel> is True, File Modifiers else
132
133 GeneralModifier (me; formodel : Boolean; num : Integer)
134 returns mutable GeneralModifier;
135 ---Purpose : Returns a Modifier of the list, given its rank :
136 -- Model Modifiers if <formodel> is True, File Modifiers else
137
138 ModelModifier (me; num : Integer) returns mutable Modifier;
139 ---Purpose : Returns a Modifier of the list of Model Modifiers, duely casted
140
141 ModifierRank (me; modifier : GeneralModifier) returns Integer;
142 ---Purpose : Gives the rank of a Modifier in the list, 0 if not in the list
143 -- Model Modifiers if <modifier> is kind of ModelModifer,
144 -- File Modifiers else
145
146 RemoveModifier (me : mutable; formodel : Boolean; num : Integer)
147 returns Boolean;
148 ---Purpose : Removes a Modifier, given it rank in the list :
149 -- Model Modifiers if <formodel> is True, File Modifiers else
150 -- Returns True if done, False if <num> is out of range
151
152 ChangeModifierRank (me : mutable; formodel : Boolean; befor,after : Integer)
153 returns Boolean;
154 ---Purpose : Changes the rank of a modifier in the list :
155 -- Model Modifiers if <formodel> is True, File Modifiers else
156 -- from <before> to <after>
157 -- Returns True if done, False else (before or after out of range)
158
159 -- -- Names for produced Files -- --
160
161 SetRootName (me : mutable; num : Integer; name : mutable HAsciiString)
162 returns Boolean;
163 ---Purpose : Attaches a Root Name to a Dispatch given its rank, as an
164 -- HAsciiString (standard form). A Null Handle resets this name.
165 -- Returns True if OK, False if this Name is already attached,
166 -- for a Dispatch or for Default, or <num> out of range
167
168 HasRootName (me; num : Integer) returns Boolean;
169 ---Purpose : Returns True if the Dispatch of rank <num> has an attached
170 -- Root Name. False else, or if num is out of range
171
172 RootName (me; num : Integer) returns mutable HAsciiString from TCollection;
173 ---Purpose : Returns the Root bound to a Dispatch, given its rank
174 -- Returns a Null Handle if not defined
175
176 RootNumber (me; name : HAsciiString) returns Integer;
177 ---Purpose : Returns an integer value about a given root name :
178 -- - positive : it's the rank of the Dispatch which has this name
179 -- - null : this root name is unknown
180 -- - negative (-1) : this root name is the default root name
181
182 SetPrefix (me : mutable; pref : HAsciiString from TCollection);
183 ---Purpose : Defines or Changes the general Prefix (which is prepended to
184 -- complete file name generated). If this method is not call,
185 -- Prefix remains empty
186
187 SetDefaultRootName (me : mutable; defrt : HAsciiString from TCollection)
188 returns Boolean;
189 ---Purpose : Defines or Changes the Default Root Name to a new value (which
190 -- is used for dispatches which have no attached root name).
191 -- If this method is not called, DefaultRootName remains empty
192 -- Returns True if OK, False if this Name is already attached,
193 -- for a Dispatch or for Default
194
195 SetExtension (me : mutable; ext : HAsciiString from TCollection);
196 ---Purpose : Defines or Changes the general Extension (which is appended to
197 -- complete file name generated). If this method is not call,
198 -- Extension remains empty
199
200 Prefix (me) returns HAsciiString from TCollection;
201 ---Purpose : Returns the general Prefix. Can be empty.
202
203 DefaultRootName (me) returns HAsciiString from TCollection;
204 ---Purpose : Returns the Default Root Name. Can be empty.
205
206 Extension (me) returns HAsciiString from TCollection;
207 ---Purpose : Returns the general Extension. Can be empty (not recommanded)
208
209 FileName (me : mutable; dnum, pnum : Integer; nbpack : Integer = 0)
210 returns AsciiString from TCollection;
211 ---Purpose : Computes the complete file name for a Packet of a Dispatch,
212 -- given Dispatch Number (Rank), Packet Number, and Count of
213 -- Packets generated by this Dispatch (0 if unknown)
214 --
215 -- File Name is made of following strings, concatenated :
216 -- General Prefix, Root Name for Dispatch, Packet Suffix, and
217 -- General Extension. If no Root Name is specified for a
218 -- Dispatch, DefaultRootName is considered (and pnum is not used,
219 -- but <thenbdefs> is incremented and used
220 -- Error if no Root is defined for this <idnum>
221
222fields
223
224 thedisps : TSeqOfDispatch;
225 themodelmodifiers : SequenceOfGeneralModifier;
226 thefilemodifiers : SequenceOfGeneralModifier;
227 thepref : HAsciiString from TCollection;
228 thedefrt : HAsciiString from TCollection;
229 theext : HAsciiString from TCollection;
230 thenbdefs : Integer;
231 thelastrun : Integer;
232
233end ShareOut;