Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:08

0001 // Created on: 1993-02-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 _Interface_ReaderModule_HeaderFile
0018 #define _Interface_ReaderModule_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Standard_Transient.hxx>
0024 #include <Standard_Integer.hxx>
0025 class Interface_FileReaderData;
0026 class Interface_Check;
0027 
0028 
0029 class Interface_ReaderModule;
0030 DEFINE_STANDARD_HANDLE(Interface_ReaderModule, Standard_Transient)
0031 
0032 //! Defines unitary operations required to read an Entity from a
0033 //! File (see FileReaderData, FileReaderTool), under control of
0034 //! a FileReaderTool. The initial creation is performed by a
0035 //! GeneralModule (set in GeneralLib). Then, which remains is
0036 //! Loading data from the FileReaderData to the Entity
0037 //!
0038 //! To work, a GeneralModule has formerly recognized the Type read
0039 //! from FileReaderData as a positive Case Number, then the
0040 //! ReaderModule reads it according to this Case Number
0041 class Interface_ReaderModule : public Standard_Transient
0042 {
0043 
0044 public:
0045 
0046   
0047   //! Translates the type of record <num> in <data> to a positive
0048   //! Case Number. If Recognition fails, must return 0
0049   Standard_EXPORT virtual Standard_Integer CaseNum (const Handle(Interface_FileReaderData)& data, const Standard_Integer num) const = 0;
0050   
0051   //! Performs the effective loading from <data>, record <num>,
0052   //! to the Entity <ent> formerly created
0053   //! In case of Error or Warning, fills <ach> with messages
0054   //! Remark that the Case Number comes from translating a record
0055   Standard_EXPORT virtual void Read (const Standard_Integer casenum, const Handle(Interface_FileReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(Standard_Transient)& ent) const = 0;
0056   
0057   //! Specific operator (create+read) defaulted to do nothing.
0058   //! It can be redefined when it is not possible to work in two
0059   //! steps (NewVoid then Read). This occurs when no default
0060   //! constructor is defined : hence the result <ent> must be
0061   //! created with an effective definition from the reader.
0062   //! Remark : if NewRead is defined, Copy has nothing to do.
0063   //!
0064   //! Returns True if it has produced something, false else.
0065   //! If nothing was produced, <ach> should be filled : it will be
0066   //! treated as "Unrecognized case" by reader tool.
0067   Standard_EXPORT virtual Standard_Boolean NewRead (const Standard_Integer casenum, const Handle(Interface_FileReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, Handle(Standard_Transient)& ent) const;
0068 
0069 
0070 
0071 
0072   DEFINE_STANDARD_RTTIEXT(Interface_ReaderModule,Standard_Transient)
0073 
0074 protected:
0075 
0076 
0077 
0078 
0079 private:
0080 
0081 
0082 
0083 
0084 };
0085 
0086 
0087 
0088 
0089 
0090 
0091 
0092 #endif // _Interface_ReaderModule_HeaderFile