0032951: Coding - get rid of unused headers [GeomConvert to IGESBasic]
[occt.git] / src / IFSelect / IFSelect_SessionDumper.hxx
1 // Created on: 1993-11-04
2 // Created by: Christian CAILLET
3 // Copyright (c) 1993-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 _IFSelect_SessionDumper_HeaderFile
18 #define _IFSelect_SessionDumper_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Standard_Transient.hxx>
24 class IFSelect_SessionFile;
25 class TCollection_AsciiString;
26
27
28 class IFSelect_SessionDumper;
29 DEFINE_STANDARD_HANDLE(IFSelect_SessionDumper, Standard_Transient)
30
31 //! A SessionDumper is called by SessionFile. It takes into
32 //! account a set of classes (such as Selections, Dispatches ...).
33 //! SessionFile writes the Type (as defined by cdl) of each Item
34 //! and its general Parameters. It manages the names of the Items.
35 //!
36 //! A SessionDumper must be able to Write the Parameters which are
37 //! own of each Item it takes into account, given its Class, then
38 //! to Recognize the Type and Read its Own Parameters to create
39 //! an Item of this Type with these own Parameters.
40 //!
41 //! Then, there must be defined one sub-type of SessionDumper per
42 //! consistent set of classes (e.g. a package).
43 //!
44 //! By Own Parameters, understand Parameters given at Creation Time
45 //! if there are, or specific of a given class, apart from those
46 //! defined at superclass levels (e.g. Final Selection for a
47 //! Dispatch, Input Selection for a SelectExtract or SelectDeduct,
48 //! Direct Status for a SelectExtract, etc...).
49 //!
50 //! The Parameters are those stored in a WorkSession, they can be
51 //! of Types : IntParam, HAsciiString (for TextParam), Selection,
52 //! Dispatch.
53 //!
54 //! SessionDumpers are organized in a Library which is used by
55 //! SessionFile. They are put at Creation Time in this Library.
56 class IFSelect_SessionDumper : public Standard_Transient
57 {
58
59 public:
60
61   
62   //! Returns the First item of the Library of Dumper. The Next ones
63   //! are then obtained by Next on the returned items
64   Standard_EXPORT static Handle(IFSelect_SessionDumper) First();
65   
66   //! Returns the Next SesionDumper in the Library. Returns a Null
67   //! Handle at the End.
68   Standard_EXPORT Handle(IFSelect_SessionDumper) Next() const;
69   
70   //! Writes the Own Parameters of a given Item, if it forecast to
71   //! manage its Type.
72   //! Returns True if it has recognized the Type of the Item (in
73   //! this case, it is assumed to have written the Own Parameters if
74   //! there are some), False else : in that case, SessionFile will
75   //! try another SessionDumper in the Library.
76   //! WriteOwn can use these methods from SessionFile : SendVoid,
77   //! SendItem, SendText, and if necessary, WorkSession.
78   Standard_EXPORT virtual Standard_Boolean WriteOwn (IFSelect_SessionFile& file, const Handle(Standard_Transient)& item) const = 0;
79   
80   //! Recognizes a Type (given as <type>) then Creates an Item of
81   //! this Type with the Own Parameter, as required.
82   //! Returns True if it has recognized the Type (in this case, it
83   //! is assumed to have created the Item, returned as <item>),
84   //! False else : in that case, SessionFile will try another
85   //! SessionDumper in the Library.
86   //! ReadOwn can use these methods from SessionFile to access Own
87   //! Parameters : NbOwnParams, IsVoid, IsText, TextValue, ItemValue
88   Standard_EXPORT virtual Standard_Boolean ReadOwn (IFSelect_SessionFile& file, const TCollection_AsciiString& type, Handle(Standard_Transient)& item) const = 0;
89
90
91
92
93   DEFINE_STANDARD_RTTIEXT(IFSelect_SessionDumper,Standard_Transient)
94
95 protected:
96
97   
98   //! The Initialization puts a just created SessionDumper in the
99   //! Library of SessionDumper. Then, it suffices to create once
100   //! a SessionDumper to fill the Library with it
101   Standard_EXPORT IFSelect_SessionDumper();
102
103
104
105 private:
106
107
108   Handle(IFSelect_SessionDumper) thenext;
109
110
111 };
112
113
114
115
116
117
118
119 #endif // _IFSelect_SessionDumper_HeaderFile