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
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 SessionDumper from IFSelect inherits TShared
19 ---Purpose : A SessionDumper is called by SessionFile. It takes into
20 -- account a set of classes (such as Selections, Dispatches ...).
21 -- SessionFile writes the Type (as defined by cdl) of each Item
22 -- and its general Parameters. It manages the names of the Items.
24 -- A SessionDumper must be able to Write the Parameters which are
25 -- own of each Item it takes into account, given its Class, then
26 -- to Recognize the Type and Read its Own Parameters to create
27 -- an Item of this Type with these own Parameters.
29 -- Then, there must be defined one sub-type of SessionDumper per
30 -- consistent set of classes (e.g. a package).
32 -- By Own Parameters, understand Parameters given at Creation Time
33 -- if there are, or specific of a given class, apart from those
34 -- defined at superclass levels (e.g. Final Selection for a
35 -- Dispatch, Input Selection for a SelectExtract or SelectDeduct,
36 -- Direct Status for a SelectExtract, etc...).
38 -- The Parameters are those stored in a WorkSession, they can be
39 -- of Types : IntParam, HAsciiString (for TextParam), Selection,
42 -- SessionDumpers are organized in a Library which is used by
43 -- SessionFile. They are put at Creation Time in this Library.
45 uses Transient, AsciiString from TCollection, SessionFile
50 ---Purpose : The Initialization puts a just created SessionDumper in the
51 -- Library of SessionDumper. Then, it suffices to create once
52 -- a SessionDumper to fill the Library with it
54 First (myclass) returns SessionDumper;
55 ---Purpose : Returns the First item of the Library of Dumper. The Next ones
56 -- are then obtained by Next on the returned items
58 Next (me) returns SessionDumper;
59 ---Purpose : Returns the Next SesionDumper in the Library. Returns a Null
62 WriteOwn (me; file : in out SessionFile; item : Transient)
63 returns Boolean is deferred;
64 ---Purpose : Writes the Own Parameters of a given Item, if it forecast to
66 -- Returns True if it has recognized the Type of the Item (in
67 -- this case, it is assumed to have written the Own Parameters if
68 -- there are some), False else : in that case, SessionFile will
69 -- try another SessionDumper in the Library.
70 -- WriteOwn can use these methods from SessionFile : SendVoid,
71 -- SendItem, SendText, and if necessary, WorkSession.
73 ReadOwn (me; file : in out SessionFile;
74 type : AsciiString from TCollection; item : out mutable Transient)
75 returns Boolean is deferred;
76 ---Purpose : Recognizes a Type (given as <type>) then Creates an Item of
77 -- this Type with the Own Parameter, as required.
78 -- Returns True if it has recognized the Type (in this case, it
79 -- is assumed to have created the Item, returned as <item>),
80 -- False else : in that case, SessionFile will try another
81 -- SessionDumper in the Library.
82 -- ReadOwn can use these methods from SessionFile to access Own
83 -- Parameters : NbOwnParams, IsVoid, IsText, TextValue, ItemValue
87 thenext : SessionDumper;