Warnings on vc14 were eliminated
[occt.git] / src / Transfer / Transfer_TransientProcess.hxx
1 // Created on: 1996-09-04
2 // Created by: Christian CAILLET
3 // Copyright (c) 1996-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_TransientProcess_HeaderFile
18 #define _Transfer_TransientProcess_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <TColStd_HSequenceOfTransient.hxx>
24 #include <Transfer_ProcessForTransient.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <Standard_CString.hxx>
28 #include <Standard_Type.hxx>
29 #include <Standard_Transient.hxx>
30 #include <TCollection_AsciiString.hxx>
31 #include <NCollection_DataMap.hxx>
32 class Interface_InterfaceModel;
33 class Interface_HGraph;
34 class Interface_Graph;
35 class Message_Messenger;
36 class Interface_EntityIterator;
37
38
39 class Transfer_TransientProcess;
40 DEFINE_STANDARD_HANDLE(Transfer_TransientProcess, Transfer_ProcessForTransient)
41
42 //! Adds specific features to the generic definition :
43 //! TransientProcess is intended to work from an InterfaceModel
44 //! to a set of application objects.
45 //!
46 //! Hence, some informations about starting entities can be gotten
47 //! from the model : for Trace, CheckList, Integrity Status
48 class Transfer_TransientProcess : public Transfer_ProcessForTransient
49 {
50
51 public:
52
53   
54   //! Sets TransientProcess at initial state, with an initial size
55   Standard_EXPORT Transfer_TransientProcess(const Standard_Integer nb = 10000);
56   
57   //! Sets an InterfaceModel, used by StartTrace, CheckList, queries
58   //! on Integrity, to give informations significant for each norm.
59   Standard_EXPORT void SetModel (const Handle(Interface_InterfaceModel)& model);
60   
61   //! Returns the Model used for StartTrace
62   Standard_EXPORT Handle(Interface_InterfaceModel) Model() const;
63   
64   //! Sets a Graph : superseedes SetModel if already done
65   Standard_EXPORT void SetGraph (const Handle(Interface_HGraph)& HG);
66   
67   Standard_EXPORT Standard_Boolean HasGraph() const;
68   
69   Standard_EXPORT Handle(Interface_HGraph) HGraph() const;
70   
71   Standard_EXPORT const Interface_Graph& Graph() const;
72   
73   //! Sets a Context : according to receiving appli, to be
74   //! interpreted by the Actor
75   Standard_EXPORT void SetContext (const Standard_CString name, const Handle(Standard_Transient)& ctx);
76   
77   //! Returns the Context attached to a name, if set and if it is
78   //! Kind of the type, else a Null Handle
79   //! Returns True if OK, False if no Context
80   Standard_EXPORT Standard_Boolean GetContext (const Standard_CString name, const Handle(Standard_Type)& type, Handle(Standard_Transient)& ctx) const;
81   
82   //! Returns (modifiable) the whole definition of Context
83   //! Rather for internal use (ex.: preparing and setting in once)
84   Standard_EXPORT NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)>& Context();
85   
86   //! Specific printing to trace an entity : prints label and type
87   //! (if model is set)
88   Standard_EXPORT virtual void PrintTrace (const Handle(Standard_Transient)& start, const Handle(Message_Messenger)& S) const Standard_OVERRIDE;
89   
90   //! Specific number of a starting object for check-list : Number
91   //! in model
92   Standard_EXPORT virtual Standard_Integer CheckNum (const Handle(Standard_Transient)& ent) const Standard_OVERRIDE;
93   
94   //! Returns the list of sharings entities, AT ANY LEVEL, which are
95   //! kind of a given type. Calls TypedSharings from Graph
96   //! Returns an empty list if the Graph has not been aknowledged
97   Standard_EXPORT Interface_EntityIterator TypedSharings (const Handle(Standard_Transient)& start, const Handle(Standard_Type)& type) const;
98   
99   //! Tells if an entity is well loaded from file (even if its data
100   //! fail on checking, they are present). Mostly often, answers
101   //! True. Else, there was a syntactic error in the file.
102   //! A non-loaded entity MAY NOT BE transferred, unless its Report
103   //! (in the model) is interpreted
104   Standard_EXPORT Standard_Boolean IsDataLoaded (const Handle(Standard_Transient)& ent) const;
105   
106   //! Tells if an entity fails on data checking (load time,
107   //! syntactic, or semantic check). Normally, should answer False.
108   //! It is not prudent to try transferring an entity which fails on
109   //! data checking
110   Standard_EXPORT Standard_Boolean IsDataFail (const Handle(Standard_Transient)& ent) const;
111   
112   //! Prints statistics on a given output, according mode
113   Standard_EXPORT void PrintStats (const Standard_Integer mode, const Handle(Message_Messenger)& S) const;
114   
115   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) RootsForTransfer();
116
117
118
119
120   DEFINE_STANDARD_RTTIEXT(Transfer_TransientProcess,Transfer_ProcessForTransient)
121
122 protected:
123
124
125
126
127 private:
128
129
130   Handle(Interface_InterfaceModel) themodel;
131   Handle(Interface_HGraph) thegraph;
132   NCollection_DataMap<TCollection_AsciiString, Handle(Standard_Transient)> thectx;
133   Handle(TColStd_HSequenceOfTransient) thetrroots;
134
135
136 };
137
138
139
140
141
142
143
144 #endif // _Transfer_TransientProcess_HeaderFile