42cf5bc1 |
1 | // Created on: 1992-02-03 |
2 | // Created by: Christian CAILLET |
3 | // Copyright (c) 1992-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
8 | // This library is free software; you can redistribute it and/or modify it under |
9 | // the terms of the GNU Lesser General Public License version 2.1 as published |
10 | // by the Free Software Foundation, with special exception defined in the file |
11 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | // distribution for complete text of the license and disclaimer of any warranty. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Transfer_ProcessForFinder_HeaderFile |
18 | #define _Transfer_ProcessForFinder_HeaderFile |
19 | |
42cf5bc1 |
20 | #include <TColStd_IndexedMapOfInteger.hxx> |
42cf5bc1 |
21 | #include <Transfer_HSequenceOfFinder.hxx> |
5d88fd54 |
22 | #include <Transfer_TransferMapOfProcessForFinder.hxx> |
23 | |
42cf5bc1 |
24 | class Message_Messenger; |
25 | class Transfer_Finder; |
26 | class Transfer_Binder; |
27 | class Transfer_ActorOfProcessForFinder; |
28 | class Message_ProgressIndicator; |
29 | class Interface_InterfaceError; |
30 | class Transfer_TransferFailure; |
31 | class Transfer_FindHasher; |
42cf5bc1 |
32 | class Transfer_IteratorOfProcessForFinder; |
33 | class Message_Msg; |
34 | class Interface_Check; |
35 | class Standard_Transient; |
36 | class Interface_CheckIterator; |
37 | |
38 | |
39 | class Transfer_ProcessForFinder; |
25e59720 |
40 | DEFINE_STANDARD_HANDLE(Transfer_ProcessForFinder, Standard_Transient) |
42cf5bc1 |
41 | |
42 | |
25e59720 |
43 | class Transfer_ProcessForFinder : public Standard_Transient |
42cf5bc1 |
44 | { |
45 | |
46 | public: |
47 | |
48 | |
36b9ff75 |
49 | //! Sets TransferProcess at initial state. Gives an Initial size |
50 | //! (indicative) for the Map when known (default is 10000). |
51 | //! Sets default trace file as a printer and default trace level |
52 | //! (see Message_TraceFile). |
42cf5bc1 |
53 | Standard_EXPORT Transfer_ProcessForFinder(const Standard_Integer nb = 10000); |
54 | |
36b9ff75 |
55 | //! Sets TransferProcess at initial state. Gives an Initial size |
56 | //! (indicative) for the Map when known (default is 10000). |
57 | //! Sets a specified printer. |
42cf5bc1 |
58 | Standard_EXPORT Transfer_ProcessForFinder(const Handle(Message_Messenger)& printer, const Standard_Integer nb = 10000); |
59 | |
36b9ff75 |
60 | //! Resets a TransferProcess as ready for a completely new work. |
61 | //! Clears general data (roots) and the Map |
42cf5bc1 |
62 | Standard_EXPORT void Clear(); |
63 | |
36b9ff75 |
64 | //! Rebuilds the Map and the roots to really remove Unbound items |
65 | //! Because Unbind keeps the entity in place, even if not bound |
66 | //! Hence, working by checking new items is meaningless if a |
67 | //! formerly unbound item is rebound |
42cf5bc1 |
68 | Standard_EXPORT void Clean(); |
69 | |
36b9ff75 |
70 | //! Resizes the Map as required (if a new reliable value has been |
71 | //! determined). Acts only if <nb> is greater than actual NbMapped |
42cf5bc1 |
72 | Standard_EXPORT void Resize (const Standard_Integer nb); |
73 | |
36b9ff75 |
74 | //! Defines an Actor, which is used for automatic Transfer |
75 | //! If already defined, the new Actor is cumulated |
76 | //! (see SetNext from Actor) |
42cf5bc1 |
77 | Standard_EXPORT void SetActor (const Handle(Transfer_ActorOfProcessForFinder)& actor); |
78 | |
36b9ff75 |
79 | //! Returns the defined Actor. Returns a Null Handle if |
80 | //! not set. |
42cf5bc1 |
81 | Standard_EXPORT Handle(Transfer_ActorOfProcessForFinder) Actor() const; |
82 | |
36b9ff75 |
83 | //! Returns the Binder which is linked with a starting Object |
84 | //! It can either bring a Result (Transfer done) or none (for a |
85 | //! pre-binding). |
86 | //! If no Binder is linked with <start>, returns a Null Handle |
87 | //! Considers a category number, by default 0 |
42cf5bc1 |
88 | Standard_EXPORT Handle(Transfer_Binder) Find (const Handle(Transfer_Finder)& start) const; |
89 | |
36b9ff75 |
90 | //! Returns True if a Result (whatever its form) is Bound with |
91 | //! a starting Object. I.e., if a Binder with a Result set, |
92 | //! is linked with it |
93 | //! Considers a category number, by default 0 |
42cf5bc1 |
94 | Standard_EXPORT Standard_Boolean IsBound (const Handle(Transfer_Finder)& start) const; |
95 | |
36b9ff75 |
96 | //! Returns True if the result of the transfer of an object is |
97 | //! already used in other ones. If it is, Rebind cannot change it. |
98 | //! Considers a category number, by default 0 |
42cf5bc1 |
99 | Standard_EXPORT Standard_Boolean IsAlreadyUsed (const Handle(Transfer_Finder)& start) const; |
100 | |
36b9ff75 |
101 | //! Creates a Link a starting Object with a Binder. This Binder |
102 | //! can either bring a Result (effective Binding) or none (it can |
103 | //! be set later : pre-binding). |
104 | //! Considers a category number, by default 0 |
42cf5bc1 |
105 | Standard_EXPORT void Bind (const Handle(Transfer_Finder)& start, const Handle(Transfer_Binder)& binder); |
106 | |
36b9ff75 |
107 | //! Changes the Binder linked with a starting Object for its |
108 | //! unitary transfer. This it can be useful when the exact form |
109 | //! of the result is known once the transfer is widely engaged. |
110 | //! This can be done only on first transfer. |
111 | //! Considers a category number, by default 0 |
42cf5bc1 |
112 | Standard_EXPORT void Rebind (const Handle(Transfer_Finder)& start, const Handle(Transfer_Binder)& binder); |
113 | |
36b9ff75 |
114 | //! Removes the Binder linked with a starting object |
115 | //! If this Binder brings a non-empty Check, it is replaced by |
116 | //! a VoidBinder. Also removes from the list of Roots as required. |
117 | //! Returns True if done, False if <start> was not bound |
118 | //! Considers a category number, by default 0 |
42cf5bc1 |
119 | Standard_EXPORT Standard_Boolean Unbind (const Handle(Transfer_Finder)& start); |
120 | |
36b9ff75 |
121 | //! Returns a Binder for a starting entity, as follows : |
122 | //! Tries to Find the already bound one |
123 | //! If none found, creates a VoidBinder and Binds it |
42cf5bc1 |
124 | Standard_EXPORT Handle(Transfer_Binder) FindElseBind (const Handle(Transfer_Finder)& start); |
125 | |
36b9ff75 |
126 | //! Sets Messenger used for outputting messages. |
42cf5bc1 |
127 | Standard_EXPORT void SetMessenger (const Handle(Message_Messenger)& messenger); |
128 | |
36b9ff75 |
129 | //! Returns Messenger used for outputting messages. |
130 | //! The returned object is guaranteed to be non-null; |
131 | //! default is Message::Messenger(). |
42cf5bc1 |
132 | Standard_EXPORT Handle(Message_Messenger) Messenger() const; |
133 | |
36b9ff75 |
134 | //! Sets trace level used for outputting messages: |
135 | //! <trace> = 0 : no trace at all |
136 | //! <trace> = 1 : handled exceptions and calls to AddError |
137 | //! <trace> = 2 : also calls to AddWarning |
138 | //! <trace> = 3 : also traces new Roots |
139 | //! (uses method ErrorTrace). |
140 | //! Default is 1 : Errors traced |
42cf5bc1 |
141 | Standard_EXPORT void SetTraceLevel (const Standard_Integer tracelev); |
142 | |
36b9ff75 |
143 | //! Returns trace level used for outputting messages. |
42cf5bc1 |
144 | Standard_EXPORT Standard_Integer TraceLevel() const; |
145 | |
36b9ff75 |
146 | //! New name for AddFail (Msg) |
42cf5bc1 |
147 | Standard_EXPORT void SendFail (const Handle(Transfer_Finder)& start, const Message_Msg& amsg); |
148 | |
36b9ff75 |
149 | //! New name for AddWarning (Msg) |
42cf5bc1 |
150 | Standard_EXPORT void SendWarning (const Handle(Transfer_Finder)& start, const Message_Msg& amsg); |
151 | |
36b9ff75 |
152 | //! Adds an information message |
153 | //! Trace is filled if trace level is at least 3 |
42cf5bc1 |
154 | Standard_EXPORT void SendMsg (const Handle(Transfer_Finder)& start, const Message_Msg& amsg); |
155 | |
36b9ff75 |
156 | //! Adds an Error message to a starting entity (to the check of |
157 | //! its Binder of category 0, as a Fail) |
42cf5bc1 |
158 | Standard_EXPORT void AddFail (const Handle(Transfer_Finder)& start, const Standard_CString mess, const Standard_CString orig = ""); |
159 | |
36b9ff75 |
160 | //! (other name of AddFail, maintained for compatibility) |
42cf5bc1 |
161 | Standard_EXPORT void AddError (const Handle(Transfer_Finder)& start, const Standard_CString mess, const Standard_CString orig = ""); |
162 | |
36b9ff75 |
163 | //! Adds an Error Message to a starting entity from the definition |
164 | //! of a Msg (Original+Value) |
42cf5bc1 |
165 | Standard_EXPORT void AddFail (const Handle(Transfer_Finder)& start, const Message_Msg& amsg); |
166 | |
36b9ff75 |
167 | //! Adds a Warning message to a starting entity (to the check of |
168 | //! its Binder of category 0) |
42cf5bc1 |
169 | Standard_EXPORT void AddWarning (const Handle(Transfer_Finder)& start, const Standard_CString mess, const Standard_CString orig = ""); |
170 | |
36b9ff75 |
171 | //! Adds a Warning Message to a starting entity from the definition |
172 | //! of a Msg (Original+Value) |
42cf5bc1 |
173 | Standard_EXPORT void AddWarning (const Handle(Transfer_Finder)& start, const Message_Msg& amsg); |
174 | |
175 | Standard_EXPORT void Mend (const Handle(Transfer_Finder)& start, const Standard_CString pref = ""); |
176 | |
36b9ff75 |
177 | //! Returns the Check attached to a starting entity. If <start> |
178 | //! is unknown, returns an empty Check |
179 | //! Adds a case name to a starting entity |
180 | //! Adds a case value to a starting entity |
181 | //! Returns the complete case list for an entity. Null Handle if empty |
182 | //! In the list of mapped items (between 1 and NbMapped), |
183 | //! searches for the first item which follows <num0>(not included) |
184 | //! and which has an attribute named <name> |
185 | //! Attributes are brought by Binders |
186 | //! Hence, allows such an iteration |
187 | //! |
188 | //! for (num = TP->NextItemWithAttribute(name,0); |
189 | //! num > 0; |
190 | //! num = TP->NextItemWithAttribute(name,num) { |
191 | //! .. process mapped item <num> |
192 | //! } |
193 | //! Returns the type of an Attribute attached to binders |
194 | //! If this name gives no Attribute, returns ParamVoid |
195 | //! If this name gives several different types, returns ParamMisc |
196 | //! Else, returns the effective type (ParamInteger, ParamReal, |
197 | //! ParamIdent, or ParamText) |
198 | //! Returns the list of recorded Attribute Names, as a Dictionary |
199 | //! of Integer : each value gives the count of items which bring |
200 | //! this attribute name |
201 | //! By default, considers all the attribute names |
202 | //! If <rootname> is given, considers only the attribute names |
203 | //! which begin by <rootname> |
42cf5bc1 |
204 | Standard_EXPORT Handle(Interface_Check) Check (const Handle(Transfer_Finder)& start) const; |
205 | |
36b9ff75 |
206 | //! Binds a starting object with a Transient Result. |
207 | //! Uses a SimpleBinderOfTransient to work. If there is already |
208 | //! one but with no Result set, sets its Result. |
209 | //! Considers a category number, by default 0 |
42cf5bc1 |
210 | Standard_EXPORT void BindTransient (const Handle(Transfer_Finder)& start, const Handle(Standard_Transient)& res); |
211 | |
36b9ff75 |
212 | //! Returns the Result of the Transfer of an object <start> as a |
213 | //! Transient Result. |
214 | //! Returns a Null Handle if there is no Transient Result |
215 | //! Considers a category number, by default 0 |
216 | //! Warning : Supposes that Binding is done with a SimpleBinderOfTransient |
42cf5bc1 |
217 | Standard_EXPORT const Handle(Standard_Transient)& FindTransient (const Handle(Transfer_Finder)& start) const; |
218 | |
36b9ff75 |
219 | //! Prepares an object <start> to be bound with several results. |
220 | //! If no Binder is yet attached to <obj>, a MultipleBinder |
221 | //! is created, empty. If a Binder is already set, it must |
222 | //! accept Multiple Binding. |
223 | //! Considers a category number, by default 0 |
42cf5bc1 |
224 | Standard_EXPORT void BindMultiple (const Handle(Transfer_Finder)& start); |
225 | |
36b9ff75 |
226 | //! Adds an item to a list of results bound to a starting object. |
227 | //! Considers a category number, by default 0, for all results |
42cf5bc1 |
228 | Standard_EXPORT void AddMultiple (const Handle(Transfer_Finder)& start, const Handle(Standard_Transient)& res); |
229 | |
36b9ff75 |
230 | //! Searches for a transient result attached to a starting object, |
231 | //! according to its type, by criterium IsKind(atype) |
232 | //! |
233 | //! In case of multiple result, explores the list and gives in |
234 | //! <val> the first transient result IsKind(atype) |
235 | //! Returns True and fills <val> if found |
236 | //! Else, returns False (<val> is not touched, not even nullified) |
237 | //! |
238 | //! This syntactic form avoids to do DownCast : if a result is |
239 | //! found with the good type, it is loaded in <val> and can be |
240 | //! immediately used, well initialised |
42cf5bc1 |
241 | Standard_EXPORT Standard_Boolean FindTypedTransient (const Handle(Transfer_Finder)& start, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const; |
242 | |
aa00364d |
243 | //! Safe variant for arbitrary type of argument |
244 | template <class T> |
245 | Standard_Boolean FindTypedTransient (const Handle(Transfer_Finder)& start, const Handle(Standard_Type)& atype, Handle(T)& val) const |
246 | { |
247 | Handle(Standard_Transient) aVal = val; |
248 | return FindTypedTransient (start, atype, aVal) && ! (val = Handle(T)::DownCast(aVal)).IsNull(); |
249 | } |
250 | |
36b9ff75 |
251 | //! Searches for a transient result recorded in a Binder, whatever |
252 | //! this Binder is recorded or not in <me> |
253 | //! |
254 | //! This is strictly equivalent to the class method GetTypedResult |
255 | //! from class SimpleBinderOfTransient, but is just lighter to call |
256 | //! |
257 | //! Apart from this, works as FindTypedTransient |
42cf5bc1 |
258 | Standard_EXPORT Standard_Boolean GetTypedTransient (const Handle(Transfer_Binder)& binder, const Handle(Standard_Type)& atype, Handle(Standard_Transient)& val) const; |
259 | |
aa00364d |
260 | //! Safe variant for arbitrary type of argument |
261 | template <class T> |
262 | Standard_Boolean GetTypedTransient (const Handle(Transfer_Binder)& start, const Handle(Standard_Type)& atype, Handle(T)& val) const |
263 | { |
264 | Handle(Standard_Transient) aVal = val; |
265 | return GetTypedTransient (start, atype, aVal) && ! (val = Handle(T)::DownCast(aVal)).IsNull(); |
266 | } |
267 | |
36b9ff75 |
268 | //! Returns the maximum possible value for Map Index |
269 | //! (no result can be bound with a value greater than it) |
42cf5bc1 |
270 | Standard_EXPORT Standard_Integer NbMapped() const; |
271 | |
36b9ff75 |
272 | //! Returns the Starting Object bound to an Index, |
42cf5bc1 |
273 | Standard_EXPORT const Handle(Transfer_Finder)& Mapped (const Standard_Integer num) const; |
274 | |
36b9ff75 |
275 | //! Returns the Index value bound to a Starting Object, 0 if none |
42cf5bc1 |
276 | Standard_EXPORT Standard_Integer MapIndex (const Handle(Transfer_Finder)& start) const; |
277 | |
36b9ff75 |
278 | //! Returns the Binder bound to an Index |
279 | //! Considers a category number, by default 0 |
42cf5bc1 |
280 | Standard_EXPORT Handle(Transfer_Binder) MapItem (const Standard_Integer num) const; |
281 | |
36b9ff75 |
282 | //! Declares <obj> (and its Result) as Root. This status will be |
283 | //! later exploited by RootResult, see below (Result can be |
284 | //! produced at any time) |
42cf5bc1 |
285 | Standard_EXPORT void SetRoot (const Handle(Transfer_Finder)& start); |
286 | |
36b9ff75 |
287 | //! Enable (if <stat> True) or Disables (if <stat> False) Root |
288 | //! Management. If it is set, Transfers are considered as stacked |
289 | //! (a first Transfer commands other Transfers, and so on) and |
290 | //! the Transfers commanded by an external caller are "Root". |
291 | //! Remark : SetRoot can be called whatever this status, on every |
292 | //! object. |
293 | //! Default is set to True. |
42cf5bc1 |
294 | Standard_EXPORT void SetRootManagement (const Standard_Boolean stat); |
295 | |
36b9ff75 |
296 | //! Returns the count of recorded Roots |
42cf5bc1 |
297 | Standard_EXPORT Standard_Integer NbRoots() const; |
298 | |
36b9ff75 |
299 | //! Returns a Root Entity given its number in the list (1-NbRoots) |
42cf5bc1 |
300 | Standard_EXPORT const Handle(Transfer_Finder)& Root (const Standard_Integer num) const; |
301 | |
36b9ff75 |
302 | //! Returns the Binder bound with a Root Entity given its number |
303 | //! Considers a category number, by default 0 |
42cf5bc1 |
304 | Standard_EXPORT Handle(Transfer_Binder) RootItem (const Standard_Integer num) const; |
305 | |
36b9ff75 |
306 | //! Returns the index in the list of roots for a starting item, |
307 | //! or 0 if it is not recorded as a root |
42cf5bc1 |
308 | Standard_EXPORT Standard_Integer RootIndex (const Handle(Transfer_Finder)& start) const; |
309 | |
36b9ff75 |
310 | //! Returns Nesting Level of Transfers (managed by methods |
311 | //! TranscriptWith & Co). Starts to zero. If no automatic Transfer |
312 | //! is used, it remains to zero. Zero means Root Level. |
42cf5bc1 |
313 | Standard_EXPORT Standard_Integer NestingLevel() const; |
314 | |
36b9ff75 |
315 | //! Resets Nesting Level of Transfers to Zero (Root Level), |
316 | //! whatever its current value. |
42cf5bc1 |
317 | Standard_EXPORT void ResetNestingLevel(); |
318 | |
36b9ff75 |
319 | //! Tells if <start> has been recognized as good candidate for |
320 | //! Transfer. i.e. queries the Actor and its Nexts |
42cf5bc1 |
321 | Standard_EXPORT Standard_Boolean Recognize (const Handle(Transfer_Finder)& start) const; |
322 | |
36b9ff75 |
323 | //! Performs the Transfer of a Starting Object, by calling |
324 | //! the method TransferProduct (see below). |
325 | //! Mapping and Roots are managed : nothing is done if a Result is |
326 | //! already Bound, an exception is raised in case of error. |
42cf5bc1 |
327 | Standard_EXPORT Handle(Transfer_Binder) Transferring (const Handle(Transfer_Finder)& start); |
328 | |
36b9ff75 |
329 | //! Same as Transferring but does not return the Binder. |
330 | //! Simply returns True in case of success (for user call) |
42cf5bc1 |
331 | Standard_EXPORT Standard_Boolean Transfer (const Handle(Transfer_Finder)& start); |
332 | |
36b9ff75 |
333 | //! Allows controls if exceptions will be handled |
334 | //! Transfer Operations |
335 | //! <err> False : they are not handled with try {} catch {} |
336 | //! <err> True : they are |
337 | //! Default is False: no handling performed |
42cf5bc1 |
338 | Standard_EXPORT void SetErrorHandle (const Standard_Boolean err); |
339 | |
36b9ff75 |
340 | //! Returns error handling flag |
42cf5bc1 |
341 | Standard_EXPORT Standard_Boolean ErrorHandle() const; |
342 | |
36b9ff75 |
343 | //! Method called when trace is asked |
344 | //! Calls PrintTrace to display information relevant for starting |
345 | //! objects (which can be redefined) |
346 | //! <level> is Nesting Level of Transfer (0 = root) |
347 | //! <mode> controls the way the trace is done : |
348 | //! 0 neutral, 1 for Error, 2 for Warning message, 3 for new Root |
42cf5bc1 |
349 | Standard_EXPORT void StartTrace (const Handle(Transfer_Binder)& binder, const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Integer mode) const; |
350 | |
36b9ff75 |
351 | //! Prints a short information on a starting object. By default |
352 | //! prints its Dynamic Type. Can be redefined |
0ebe5b0a |
353 | Standard_EXPORT virtual void PrintTrace (const Handle(Transfer_Finder)& start, Standard_OStream& S) const; |
42cf5bc1 |
354 | |
36b9ff75 |
355 | //! Returns True if we are surely in a DeadLoop. Evaluation is not |
356 | //! exact, it is a "majorant" which must be computed fast. |
357 | //! This "majorant" is : <alevel> greater than NbMapped. |
42cf5bc1 |
358 | Standard_EXPORT Standard_Boolean IsLooping (const Standard_Integer alevel) const; |
359 | |
36b9ff75 |
360 | //! Returns, as an iterator, the log of root transfer, i.e. the |
361 | //! created objects and Binders bound to starting roots |
362 | //! If withstart is given True, Starting Objets are also returned |
42cf5bc1 |
363 | Standard_EXPORT Transfer_IteratorOfProcessForFinder RootResult (const Standard_Boolean withstart = Standard_False) const; |
364 | |
36b9ff75 |
365 | //! Returns, as an Iterator, the entire log of transfer (list of |
366 | //! created objects and Binders which can bring errors) |
367 | //! If withstart is given True, Starting Objets are also returned |
42cf5bc1 |
368 | Standard_EXPORT Transfer_IteratorOfProcessForFinder CompleteResult (const Standard_Boolean withstart = Standard_False) const; |
369 | |
36b9ff75 |
370 | //! Returns Binders which are neither "Done" nor "Initial", |
371 | //! that is Error,Loop or Run (abnormal states at end of Transfer) |
372 | //! Starting Objects are given in correspondance in the iterator |
42cf5bc1 |
373 | Standard_EXPORT Transfer_IteratorOfProcessForFinder AbnormalResult() const; |
374 | |
36b9ff75 |
375 | //! Returns a CheckList as a list of Check : each one is for a |
376 | //! starting entity which have either check (warning or fail) |
377 | //! messages are attached, or are in abnormal state : that case |
378 | //! gives a specific message |
379 | //! If <erronly> is True, checks with Warnings only are ignored |
42cf5bc1 |
380 | Standard_EXPORT Interface_CheckIterator CheckList (const Standard_Boolean erronly) const; |
381 | |
36b9ff75 |
382 | //! Returns, as an Iterator, the log of transfer for one object |
383 | //! <level> = 0 : this object only |
384 | //! and if <start> is a scope owner (else, <level> is ignored) : |
385 | //! <level> = 1 : object plus its immediate scoped ones |
386 | //! <level> = 2 : object plus all its scoped ones |
42cf5bc1 |
387 | Standard_EXPORT Transfer_IteratorOfProcessForFinder ResultOne (const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Boolean withstart = Standard_False) const; |
388 | |
36b9ff75 |
389 | //! Returns a CheckList for one starting object |
390 | //! <level> interpreted as by ResultOne |
391 | //! If <erronly> is True, checks with Warnings only are ignored |
42cf5bc1 |
392 | Standard_EXPORT Interface_CheckIterator CheckListOne (const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Boolean erronly) const; |
393 | |
36b9ff75 |
394 | //! Returns True if no check message is attached to a starting |
395 | //! object. <level> interpreted as by ResultOne |
396 | //! If <erronly> is True, checks with Warnings only are ignored |
42cf5bc1 |
397 | Standard_EXPORT Standard_Boolean IsCheckListEmpty (const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Boolean erronly) const; |
398 | |
36b9ff75 |
399 | //! Removes Results attached to (== Unbinds) a given object and, |
400 | //! according <level> : |
401 | //! <level> = 0 : only it |
402 | //! <level> = 1 : it plus its immediately owned sub-results(scope) |
403 | //! <level> = 2 : it plus all its owned sub-results(scope) |
42cf5bc1 |
404 | Standard_EXPORT void RemoveResult (const Handle(Transfer_Finder)& start, const Standard_Integer level, const Standard_Boolean compute = Standard_True); |
405 | |
36b9ff75 |
406 | //! Computes a number to be associated to a starting object in |
407 | //! a check or a check-list |
408 | //! By default, returns 0; can be redefined |
42cf5bc1 |
409 | Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Transfer_Finder)& start) const; |
410 | |
36b9ff75 |
411 | //! Sets Progress indicator |
42cf5bc1 |
412 | Standard_EXPORT void SetProgress (const Handle(Message_ProgressIndicator)& theProgress); |
413 | |
36b9ff75 |
414 | //! Gets Progress indicator |
42cf5bc1 |
415 | Standard_EXPORT Handle(Message_ProgressIndicator) GetProgress() const; |
416 | |
417 | |
418 | |
419 | |
25e59720 |
420 | DEFINE_STANDARD_RTTI_INLINE(Transfer_ProcessForFinder,Standard_Transient) |
42cf5bc1 |
421 | |
422 | protected: |
423 | |
424 | |
425 | |
426 | |
427 | private: |
428 | |
429 | |
36b9ff75 |
430 | //! Same as Find but stores the last access to the map, for a |
431 | //! faster access on next calls (as Bind does too) |
432 | //! Considers a category number, by default 0 |
433 | //! C++ : return const & |
42cf5bc1 |
434 | Standard_EXPORT Handle(Transfer_Binder) FindAndMask (const Handle(Transfer_Finder)& start); |
435 | |
36b9ff75 |
436 | //! Internal action of Transfer, called by Transferring, with or |
437 | //! without ErrorHandle. It invokes the Actor to work (set by |
438 | //! SetActor), and tries its Nexts if no result is produced, |
439 | //! until a Non Null Binder is produced. |
440 | //! But keep in mind that a Null Binder can allways be returned |
441 | //! if a Starting Entity has not been recognized at all. |
42cf5bc1 |
442 | Standard_EXPORT Handle(Transfer_Binder) TransferProduct (const Handle(Transfer_Finder)& start); |
443 | |
444 | Standard_Boolean theerrh; |
445 | Standard_Integer thetrace; |
446 | Handle(Message_Messenger) themessenger; |
447 | Standard_Integer thelevel; |
448 | Standard_Integer therootl; |
449 | Standard_Boolean therootm; |
450 | TColStd_IndexedMapOfInteger theroots; |
451 | Handle(Transfer_Finder) thelastobj; |
452 | Handle(Transfer_Binder) thelastbnd; |
453 | Standard_Integer theindex; |
454 | Handle(Transfer_ActorOfProcessForFinder) theactor; |
455 | Transfer_TransferMapOfProcessForFinder themap; |
456 | Handle(Message_ProgressIndicator) myProgress; |
457 | |
458 | |
459 | }; |
460 | |
461 | |
462 | |
463 | |
464 | |
465 | |
466 | |
467 | #endif // _Transfer_ProcessForFinder_HeaderFile |