summaryrefslogtreecommitdiff
path: root/inc/IFSelect_ShareOutResult.hxx
blob: 720407f5f2adc64234c3557afbc8965a7debb474 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _IFSelect_ShareOutResult_HeaderFile
#define _IFSelect_ShareOutResult_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _Handle_IFSelect_ShareOut_HeaderFile
#include <Handle_IFSelect_ShareOut.hxx>
#endif
#ifndef _Handle_IFSelect_Dispatch_HeaderFile
#include <Handle_IFSelect_Dispatch.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _TColStd_SequenceOfInteger_HeaderFile
#include <TColStd_SequenceOfInteger.hxx>
#endif
#ifndef _Interface_Graph_HeaderFile
#include <Interface_Graph.hxx>
#endif
#ifndef _IFGraph_SubPartsIterator_HeaderFile
#include <IFGraph_SubPartsIterator.hxx>
#endif
#ifndef _Handle_Interface_InterfaceModel_HeaderFile
#include <Handle_Interface_InterfaceModel.hxx>
#endif
#ifndef _Handle_IFSelect_PacketList_HeaderFile
#include <Handle_IFSelect_PacketList.hxx>
#endif
class IFSelect_ShareOut;
class IFSelect_Dispatch;
class Standard_NoSuchObject;
class Interface_InterfaceError;
class Interface_InterfaceModel;
class Interface_Graph;
class IFSelect_PacketList;
class Interface_EntityIterator;
class TCollection_AsciiString;


//! This class gives results computed from a ShareOut : simulation <br>
//!           before transfer, helps to list entities ... <br>
//!           Transfer itself will later be performed, either by a <br>
//!           TransferCopy to simply divide up a file, or a TransferDispatch <br>
//!           which can be parametred with more details <br>
class IFSelect_ShareOutResult  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  //! Creates a ShareOutResult from a ShareOut, to work on a Model <br>
//!           (without any more precision; uses Active Protocol) <br>
  Standard_EXPORT   IFSelect_ShareOutResult(const Handle(IFSelect_ShareOut)& sho,const Handle(Interface_InterfaceModel)& mod);
  //! Creates a ShareOutResult from a ShareOut, to work on a Graph <br>
//!           already computed, which defines the Input Model and can <br>
//!           specialize some Entities <br>
  Standard_EXPORT   IFSelect_ShareOutResult(const Handle(IFSelect_ShareOut)& sho,const Interface_Graph& G);
  //! Creates a ShareOutResult from a unique Dispatch, to work on <br>
//!           a Model. As if it was a ShareOut with only one Dispatch <br>
//!           (without any more precision; uses Active Protocol) <br>
//!           Allows to compute the effect of a single Dispatch <br>
  Standard_EXPORT   IFSelect_ShareOutResult(const Handle(IFSelect_Dispatch)& disp,const Handle(Interface_InterfaceModel)& mod);
  //! Creates a ShareOutResult from a unique Dispatch, to work on <br>
//!           a Graph. As if it was a ShareOut with only one Dispatch <br>
//!           Allows to compute the effect of a single Dispatch <br>
  Standard_EXPORT   IFSelect_ShareOutResult(const Handle(IFSelect_Dispatch)& disp,const Interface_Graph& G);
  //! Returns the ShareOut used to create the ShareOutResult <br>
//!           if creation from a Dispatch, returns a Null Handle <br>
  Standard_EXPORT     Handle_IFSelect_ShareOut ShareOut() const;
  //! Returns the Graph used to create theShareOutResult <br>
  Standard_EXPORT    const Interface_Graph& Graph() const;
  //! Erases computed data, in order to command a new Evaluation <br>
  Standard_EXPORT     void Reset() ;
  //! Evaluates the result of a ShareOut : determines Entities to be <br>
//!           forgotten by the ShareOut, Entities to be transferred several <br>
//!           times (duplicated), prepares an iteration on the packets to be <br>
//!           produced <br>
//!           Called the first time anyone question is asked, or after a <br>
//!           call to Reset. Works by calling the method Prepare. <br>
  Standard_EXPORT     void Evaluate() ;
  //! Returns the list of recorded Packets, under two modes : <br>
//!           - <complete> = False, the strict definition of Packets, i.e. <br>
//!             for each one, the Root Entities, to be explicitely sent <br>
//!           - <complete> = True (Default), the completely evaluated list, <br>
//!             i.e. which really gives the destination of each entity : <br>
//!             this mode allows to evaluate duplications <br>
//!           Remark that to send packets, iteration remains preferable <br>
//!           (file names are managed) <br>
  Standard_EXPORT     Handle_IFSelect_PacketList Packets(const Standard_Boolean complete = Standard_True) ;
  //! Returns the total count of produced non empty packets <br>
//!           (in out : calls Evaluate as necessary) <br>
  Standard_EXPORT     Standard_Integer NbPackets() ;
  //! Prepares the iteration on the packets <br>
//!           This method is called by Evaluate, but can be called anytime <br>
//!           The iteration consists in taking each Dispatch of the ShareOut <br>
//!           beginning by the first one, compute its packets, then iterate <br>
//!           on these packets. Once all these packets are iterated, the <br>
//!           iteration passes to the next Dispatch, or stops. <br>
//!           For a creation from a unique Dispatch, same but with only <br>
//!           this Dispatch. <br>
//!           Each packet can be listed, or really transferred (producing <br>
//!           a derived Model, from which a file can be generated) <br>
//! <br>
//!           Prepare sets the iteration to the first Dispatch, first Packet <br>
  Standard_EXPORT     void Prepare() ;
  //! Returns True if there is more packets in the current Dispatch, <br>
//!           else if there is more Dispatch in the ShareOut <br>
  Standard_EXPORT     Standard_Boolean More() ;
  //! Passes to the next Packet in the current Dispatch, or if there <br>
//!           is none, to the next Dispatch in the ShareOut <br>
  Standard_EXPORT     void Next() ;
  //! Passes to the next Dispatch, regardless about remaining packets <br>
  Standard_EXPORT     void NextDispatch() ;
  //! Returns the current Dispatch <br>
  Standard_EXPORT     Handle_IFSelect_Dispatch Dispatch() const;
  //! Returns the Rank of the current Dispatch in the ShareOut <br>
//!           Returns Zero if there is none (iteration finished) <br>
  Standard_EXPORT     Standard_Integer DispatchRank() const;
  //! Returns Number (rank) of current Packet in current Dispatch, <br>
//!           and total count of Packets in current Dispatch, as arguments <br>
  Standard_EXPORT     void PacketsInDispatch(Standard_Integer& numpack,Standard_Integer& nbpacks) const;
  //! Returns the list of Roots of the current Packet (never empty) <br>
//!           (i.e. the Entities to be themselves asked for transfer) <br>
//!           Error if there is none (iteration finished) <br>
  Standard_EXPORT     Interface_EntityIterator PacketRoot() ;
  //! Returns the complete content of the current Packet (i.e. <br>
//!           with shared entities, which will also be put in the file) <br>
  Standard_EXPORT     Interface_EntityIterator PacketContent() ;
  //! Returns the File Name which corresponds to current Packet <br>
//!           (computed by ShareOut) <br>
//!           If current Packet has no associated name (see ShareOut), <br>
//!           the returned value is Null <br>
  Standard_EXPORT     TCollection_AsciiString FileName() const;





protected:



Interface_Graph thegraph;
IFGraph_SubPartsIterator thedispres;


private:



Handle_IFSelect_ShareOut theshareout;
Handle_IFSelect_Dispatch thedispatch;
Standard_Boolean theeval;
Standard_Integer thedispnum;
Standard_Integer thepacknum;
Standard_Integer thepackdisp;
Standard_Integer thenbindisp;
TColStd_SequenceOfInteger thedisplist;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif