b311480e |
1 | -- Created on: 1992-11-17 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1992-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class ShareOutResult from IFSelect |
18 | |
19 | ---Purpose : This class gives results computed from a ShareOut : simulation |
20 | -- before transfer, helps to list entities ... |
21 | -- Transfer itself will later be performed, either by a |
22 | -- TransferCopy to simply divide up a file, or a TransferDispatch |
23 | -- which can be parametred with more details |
24 | |
25 | uses AsciiString from TCollection, SequenceOfInteger from TColStd, |
26 | InterfaceModel, EntityIterator, CopyTool, |
27 | Graph, SubPartsIterator, ShareOut, Dispatch, PacketList |
28 | |
29 | raises NoSuchObject, InterfaceError |
30 | |
31 | is |
32 | |
33 | Create (sho : mutable ShareOut; mod : InterfaceModel) returns ShareOutResult; |
34 | ---Purpose : Creates a ShareOutResult from a ShareOut, to work on a Model |
35 | -- (without any more precision; uses Active Protocol) |
36 | |
37 | Create (sho : mutable ShareOut; G : Graph) returns ShareOutResult; |
38 | ---Purpose : Creates a ShareOutResult from a ShareOut, to work on a Graph |
39 | -- already computed, which defines the Input Model and can |
40 | -- specialize some Entities |
41 | |
42 | Create (disp : Dispatch; mod : InterfaceModel) returns ShareOutResult; |
43 | ---Purpose : Creates a ShareOutResult from a unique Dispatch, to work on |
44 | -- a Model. As if it was a ShareOut with only one Dispatch |
45 | -- (without any more precision; uses Active Protocol) |
46 | -- Allows to compute the effect of a single Dispatch |
47 | |
48 | Create (disp : Dispatch; G : Graph) returns ShareOutResult; |
49 | ---Purpose : Creates a ShareOutResult from a unique Dispatch, to work on |
50 | -- a Graph. As if it was a ShareOut with only one Dispatch |
51 | -- Allows to compute the effect of a single Dispatch |
52 | |
53 | ShareOut (me) returns mutable ShareOut; |
54 | ---Purpose : Returns the ShareOut used to create the ShareOutResult |
55 | -- if creation from a Dispatch, returns a Null Handle |
56 | |
57 | |
58 | Graph (me) returns Graph; |
59 | ---Purpose : Returns the Graph used to create theShareOutResult |
60 | ---C++ : return const & |
61 | |
62 | Reset (me : in out); |
63 | ---Purpose : Erases computed data, in order to command a new Evaluation |
64 | |
65 | Evaluate (me : in out); |
66 | ---Purpose : Evaluates the result of a ShareOut : determines Entities to be |
67 | -- forgotten by the ShareOut, Entities to be transferred several |
68 | -- times (duplicated), prepares an iteration on the packets to be |
69 | -- produced |
70 | -- Called the first time anyone question is asked, or after a |
71 | -- call to Reset. Works by calling the method Prepare. |
72 | |
73 | -- -- Simulation Results -- -- |
74 | |
75 | Packets (me : in out; complete : Boolean = Standard_True) returns PacketList; |
76 | ---Purpose : Returns the list of recorded Packets, under two modes : |
77 | -- - <complete> = False, the strict definition of Packets, i.e. |
78 | -- for each one, the Root Entities, to be explicitely sent |
79 | -- - <complete> = True (Default), the completely evaluated list, |
80 | -- i.e. which really gives the destination of each entity : |
81 | -- this mode allows to evaluate duplications |
82 | -- Remark that to send packets, iteration remains preferable |
83 | -- (file names are managed) |
84 | |
85 | NbPackets (me : in out) returns Integer; |
86 | ---Purpose : Returns the total count of produced non empty packets |
87 | -- (in out : calls Evaluate as necessary) |
88 | |
89 | -- -- Transfer Operation -- -- |
90 | |
91 | Prepare (me : in out); |
92 | ---Purpose : Prepares the iteration on the packets |
93 | -- This method is called by Evaluate, but can be called anytime |
94 | -- The iteration consists in taking each Dispatch of the ShareOut |
95 | -- beginning by the first one, compute its packets, then iterate |
96 | -- on these packets. Once all these packets are iterated, the |
97 | -- iteration passes to the next Dispatch, or stops. |
98 | -- For a creation from a unique Dispatch, same but with only |
99 | -- this Dispatch. |
100 | -- Each packet can be listed, or really transferred (producing |
101 | -- a derived Model, from which a file can be generated) |
102 | -- |
103 | -- Prepare sets the iteration to the first Dispatch, first Packet |
104 | |
105 | More (me : in out) returns Boolean; |
106 | ---Purpose : Returns True if there is more packets in the current Dispatch, |
107 | -- else if there is more Dispatch in the ShareOut |
108 | |
109 | Next (me : in out); |
110 | ---Purpose : Passes to the next Packet in the current Dispatch, or if there |
111 | -- is none, to the next Dispatch in the ShareOut |
112 | |
113 | NextDispatch (me : in out); |
114 | ---Purpose : Passes to the next Dispatch, regardless about remaining packets |
115 | |
116 | Dispatch (me) returns Dispatch; |
117 | ---Purpose : Returns the current Dispatch |
118 | |
119 | DispatchRank (me) returns Integer; |
120 | ---Purpose : Returns the Rank of the current Dispatch in the ShareOut |
121 | -- Returns Zero if there is none (iteration finished) |
122 | |
123 | PacketsInDispatch (me; numpack, nbpacks : out Integer); |
124 | ---Purpose : Returns Number (rank) of current Packet in current Dispatch, |
125 | -- and total count of Packets in current Dispatch, as arguments |
126 | |
127 | PacketRoot (me : in out) returns EntityIterator raises NoSuchObject; |
128 | ---Purpose : Returns the list of Roots of the current Packet (never empty) |
129 | -- (i.e. the Entities to be themselves asked for transfer) |
130 | -- Error if there is none (iteration finished) |
131 | |
132 | PacketContent (me : in out) returns EntityIterator raises NoSuchObject; |
133 | ---Purpose : Returns the complete content of the current Packet (i.e. |
134 | -- with shared entities, which will also be put in the file) |
135 | |
136 | FileName (me) returns AsciiString from TCollection; |
137 | ---Purpose : Returns the File Name which corresponds to current Packet |
138 | -- (computed by ShareOut) |
139 | -- If current Packet has no associated name (see ShareOut), |
140 | -- the returned value is Null |
141 | |
142 | |
143 | fields |
144 | |
145 | theshareout : ShareOut; |
146 | thedispatch : Dispatch; |
147 | theeval : Boolean; |
148 | thedispnum : Integer; -- rank of current dispatch in ShareOut |
149 | thepacknum : Integer; -- global rank of packet in the result |
150 | thepackdisp : Integer; -- rank of packet in Dispatch |
151 | thenbindisp : Integer; -- count of packets in Dispatch |
152 | thedisplist : SequenceOfInteger from TColStd; |
153 | thegraph : Graph is protected; |
154 | thedispres : SubPartsIterator is protected; |
155 | |
156 | end ShareOutResult; |