1 -- Created on: 1992-11-17
2 -- Created by: Christian CAILLET
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
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.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 deferred class Dispatch from IFSelect inherits TShared
19 ---Purpose : This class allows to describe how a set of Entities has to be
20 -- dispatched into resulting Packets : a Packet is a sub-set of
21 -- the initial set of entities.
23 -- Thus, it can generate zero, one, or more Packets according
24 -- input set and criterium of dispatching. And it can let apart
25 -- some entities : it is the Remainder, which can be recovered
26 -- by a specific Selection (RemainderFromDispatch).
28 -- Depending of sub-classes, a Dispatch can potentially generate
29 -- a limited or not count of packet, and a remainder or none.
31 -- The input set is read from a specified Selection, attached to
32 -- the Dispatch : the Final Selection of the Dispatch. The input
33 -- is the Unique Root Entities list of the Final Selection
35 uses AsciiString from TCollection, HAsciiString from TCollection,
36 SubPartsIterator, EntityIterator,
37 Graph, Selection, SelectionIterator
43 SetRootName (me : mutable; name : HAsciiString);
44 ---Purpose : Sets a Root Name as an HAsciiString
45 -- To reset it, give a Null Handle (then, a ShareOut will have
46 -- to define the Default Root Name)
48 HasRootName (me) returns Boolean;
49 ---Purpose : Returns True if a specific Root Name has been set
50 -- (else, the Default Root Name has to be used)
52 RootName (me) returns any HAsciiString;
53 ---Purpose : Returns the Root Name for files produced by this dispatch
54 -- It is empty if it has not been set or if it has been reset
55 ---C++ : return const &
58 SetFinalSelection (me : mutable; sel : Selection);
59 ---Purpose : Stores (or Changes) the Final Selection for a Dispatch
61 FinalSelection (me) returns Selection;
62 ---Purpose : Returns the Final Selection of a Dispatch
63 -- we 'd like : C++ : return const &
65 Selections (me) returns SelectionIterator;
66 ---Purpose : Returns the complete list of source Selections (starting
67 -- from FinalSelection)
69 CanHaveRemainder (me) returns Boolean is virtual;
70 ---Purpose : Returns True if a Dispatch can have a Remainder, i.e. if its
71 -- criterium can let entities apart. It is a potential answer,
72 -- remainder can be empty at run-time even if answer is True.
73 -- (to attach a RemainderFromDispatch Selection is not allowed if
75 -- Default answer given here is False (can be redefined)
77 LimitedMax (me; nbent : Integer; max : out Integer) returns Boolean is virtual;
78 ---Purpose : Returns True if a Dispatch generates a count of Packets always
79 -- less than or equal to a maximum value : it can be computed
80 -- from the total count of Entities to be dispatched : <nbent>.
81 -- If answer is False, no limited maximum is expected for account
82 -- If answer is True, expected maximum is given in argument <max>
83 -- Default answer given here is False (can be redefined)
85 Label (me) returns AsciiString from TCollection is deferred;
86 ---Purpose : Returns a text which defines the way a Dispatch produces
87 -- packets (which will become files) from its Input
89 -- -- Evaluation -- --
91 GetEntities (me; G : Graph) returns EntityIterator;
92 ---Purpose : Gets Unique Root Entities from the Final Selection, given an
94 -- This the starting step for an Evaluation (Packets - Remainder)
96 PacketsCount (me; G : Graph; count : out Integer) returns Boolean is virtual;
97 ---Purpose : Returns True if Count of Packets is actually known, and the
98 -- value of the count in argument "count". Returns False if
99 -- this count is unknown. Input is given as a Graph.
100 -- This method is intended to be quick (used for file names)
101 -- hence if this count is long to compute (that is, as a result
102 -- of complete evaluation made by method Packets), it is
103 -- preferable to answer "unknown" by returning False
104 -- Default answer if False. Can be redefined.
106 Packets (me; G : Graph; packs : in out SubPartsIterator)
107 raises InterfaceError is deferred;
108 ---Purpose : Returns the list of produced Packets into argument <pack>.
109 -- Each Packet corresponds to a Part, the Entities listed are the
110 -- Roots given by the Selection. Input is given as a Graph.
111 -- Thus, to create a file from a packet, it suffices to take the
112 -- entities listed in a Part of Packets (that is, a Packet)
113 -- without worrying about Shared entities
114 -- This method can raise an Exception if data are not coherent
116 Packeted (me; G : Graph) returns EntityIterator;
117 ---Purpose : Returns the list of all Input Entities (see GetEntities) which
118 -- are put in a Packet. That is, Entities listed in GetEntities
119 -- but not in Remainder (see below). Input is given as a Graph.
120 ---See also : GetEntities, Remainder
122 Remainder (me; G : Graph) returns EntityIterator is virtual;
123 ---Purpose : Returns Remainder which is a set of Entities. Can be empty.
124 -- Default evaluation is empty (has to be redefined if
125 -- CanHaveRemainder is redefined to return True).
129 thename : HAsciiString;
130 thefinal : Selection;