Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-10 09:17:03

0001 // Created on: 1993-11-04
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1993-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IFSelect_SessionDumper_HeaderFile
0018 #define _IFSelect_SessionDumper_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 class IFSelect_SessionFile;
0025 class TCollection_AsciiString;
0026 
0027 class IFSelect_SessionDumper;
0028 DEFINE_STANDARD_HANDLE(IFSelect_SessionDumper, Standard_Transient)
0029 
0030 //! A SessionDumper is called by SessionFile. It takes into
0031 //! account a set of classes (such as Selections, Dispatches ...).
0032 //! SessionFile writes the Type (as defined by cdl) of each Item
0033 //! and its general Parameters. It manages the names of the Items.
0034 //!
0035 //! A SessionDumper must be able to Write the Parameters which are
0036 //! own of each Item it takes into account, given its Class, then
0037 //! to Recognize the Type and Read its Own Parameters to create
0038 //! an Item of this Type with these own Parameters.
0039 //!
0040 //! Then, there must be defined one sub-type of SessionDumper per
0041 //! consistent set of classes (e.g. a package).
0042 //!
0043 //! By Own Parameters, understand Parameters given at Creation Time
0044 //! if there are, or specific of a given class, apart from those
0045 //! defined at superclass levels (e.g. Final Selection for a
0046 //! Dispatch, Input Selection for a SelectExtract or SelectDeduct,
0047 //! Direct Status for a SelectExtract, etc...).
0048 //!
0049 //! The Parameters are those stored in a WorkSession, they can be
0050 //! of Types : IntParam, HAsciiString (for TextParam), Selection,
0051 //! Dispatch.
0052 //!
0053 //! SessionDumpers are organized in a Library which is used by
0054 //! SessionFile. They are put at Creation Time in this Library.
0055 class IFSelect_SessionDumper : public Standard_Transient
0056 {
0057 
0058 public:
0059   //! Returns the First item of the Library of Dumper. The Next ones
0060   //! are then obtained by Next on the returned items
0061   Standard_EXPORT static Handle(IFSelect_SessionDumper) First();
0062 
0063   //! Returns the Next SesionDumper in the Library. Returns a Null
0064   //! Handle at the End.
0065   Standard_EXPORT Handle(IFSelect_SessionDumper) Next() const;
0066 
0067   //! Writes the Own Parameters of a given Item, if it forecast to
0068   //! manage its Type.
0069   //! Returns True if it has recognized the Type of the Item (in
0070   //! this case, it is assumed to have written the Own Parameters if
0071   //! there are some), False else : in that case, SessionFile will
0072   //! try another SessionDumper in the Library.
0073   //! WriteOwn can use these methods from SessionFile : SendVoid,
0074   //! SendItem, SendText, and if necessary, WorkSession.
0075   Standard_EXPORT virtual Standard_Boolean WriteOwn(
0076     IFSelect_SessionFile&             file,
0077     const Handle(Standard_Transient)& item) const = 0;
0078 
0079   //! Recognizes a Type (given as <type>) then Creates an Item of
0080   //! this Type with the Own Parameter, as required.
0081   //! Returns True if it has recognized the Type (in this case, it
0082   //! is assumed to have created the Item, returned as <item>),
0083   //! False else : in that case, SessionFile will try another
0084   //! SessionDumper in the Library.
0085   //! ReadOwn can use these methods from SessionFile to access Own
0086   //! Parameters : NbOwnParams, IsVoid, IsText, TextValue, ItemValue
0087   Standard_EXPORT virtual Standard_Boolean ReadOwn(IFSelect_SessionFile&          file,
0088                                                    const TCollection_AsciiString& type,
0089                                                    Handle(Standard_Transient)&    item) const = 0;
0090 
0091   DEFINE_STANDARD_RTTIEXT(IFSelect_SessionDumper, Standard_Transient)
0092 
0093 protected:
0094   //! The Initialization puts a just created SessionDumper in the
0095   //! Library of SessionDumper. Then, it suffices to create once
0096   //! a SessionDumper to fill the Library with it
0097   Standard_EXPORT IFSelect_SessionDumper();
0098 
0099 private:
0100   Handle(IFSelect_SessionDumper) thenext;
0101 };
0102 
0103 #endif // _IFSelect_SessionDumper_HeaderFile