Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:27

0001 // Copyright (c) 1999-2020 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _Express_Entity_HeaderFile
0015 #define _Express_Entity_HeaderFile
0016 
0017 #include <Express_Item.hxx>
0018 #include <Standard_OStream.hxx>
0019 #include <Standard_Type.hxx>
0020 #include <TColStd_HSequenceOfHAsciiString.hxx>
0021 #include <NCollection_DataMap.hxx>
0022 
0023 class Express_HSequenceOfEntity;
0024 
0025 class Express_HSequenceOfField;
0026 
0027 class Dico_DictionaryOfInteger;
0028 
0029 //! Implements ENTITY item of the EXPRESS
0030 //! schema, with interface for deferred Item class.
0031 class Express_Entity : public Express_Item
0032 {
0033 
0034 public:
0035 
0036   //! Create ENTITY item and initialize it
0037   //! flags hasCheck and hasFillShared mark if generated class has
0038   //! methods Check and FillShared correspondingly.
0039   Standard_EXPORT Express_Entity (const Standard_CString theName,
0040                                   const Handle(TColStd_HSequenceOfHAsciiString)& theInherit,
0041                                   const Handle(Express_HSequenceOfField)& theFields);
0042 
0043   //! Returns sequence of inherited classes (names)
0044   Standard_EXPORT const Handle(TColStd_HSequenceOfHAsciiString)& SuperTypes() const;
0045 
0046   //! Returns sequence of inherited items
0047   Standard_EXPORT const Handle(Express_HSequenceOfEntity)& Inherit() const;
0048 
0049   //! Returns sequence of fields
0050   Standard_EXPORT const Handle(Express_HSequenceOfField)& Fields() const;
0051 
0052   //! Returns number of fields (only own fields if inherited is False
0053   //! and including fields of all supertypes if it is True)
0054   Standard_EXPORT Standard_Integer NbFields (const Standard_Boolean theInherited = Standard_False) const;
0055 
0056   //! Sets abstruct flag for entity;
0057   Standard_EXPORT void SetAbstractFlag (const Standard_Boolean theIsAbstract);
0058 
0059   //! Returns abstract flag.
0060   Standard_EXPORT inline Standard_Boolean AbstractFlag() const;
0061 
0062   DEFINE_STANDARD_RTTIEXT(Express_Entity, Express_Item)
0063 
0064 protected:
0065 
0066 private:
0067 
0068   typedef NCollection_DataMap<TCollection_AsciiString, Standard_Integer> DataMapOfStringInteger;
0069 
0070   //! Create HXX/CXX files from item
0071   Standard_EXPORT virtual Standard_Boolean GenerateClass() const Standard_OVERRIDE;
0072 
0073   //! Propagates the calls of Use function
0074   Standard_EXPORT virtual void PropagateUse() const Standard_OVERRIDE;
0075 
0076   //! Writes includes section of HXX
0077   Standard_EXPORT Standard_Boolean writeIncludes (Standard_OStream& theOS) const;
0078 
0079   //! Writes code for reading all fields
0080   Standard_EXPORT Standard_Integer writeRWReadCode (Standard_OStream& theOS,
0081                                                     const Standard_Integer theStart,
0082                                                     const Standard_Integer theOwn) const;
0083 
0084   //! Writes code for writing all fields
0085   Standard_EXPORT Standard_Integer writeRWWriteCode (Standard_OStream& theOS,
0086                                                      const Standard_Integer theStart,
0087                                                      const Standard_Integer theOwn) const;
0088 
0089   //! Writes code for adding shared entities to the graph
0090   Standard_EXPORT Standard_Integer writeRWShareCode (Standard_OStream& theOS,
0091                                                      const Standard_Integer theStart,
0092                                                      const Standard_Integer theOwn) const;
0093 
0094   //! Writes arguments and code for method Init()
0095   //! Mode identifies what code is being written:
0096   //! 0 - HXX declaration
0097   //! 1 - CXX declaration
0098   //! 2 - call (argument list)
0099   //! 3 - implementation
0100   //! 4 - call (argument list for RW)
0101   Standard_EXPORT Standard_Integer makeInit (Standard_OStream& theOS,
0102                                              const Standard_Integer theShift,
0103                                              const Standard_Integer theOwn,
0104                                              const Standard_Integer theMode) const;
0105 
0106 private:
0107 
0108   Handle(TColStd_HSequenceOfHAsciiString) mySupers;
0109   Handle(Express_HSequenceOfEntity) myInherit;
0110   Handle(Express_HSequenceOfField) myFields;
0111   Standard_Boolean myIsAbstract;
0112 };
0113 
0114 #endif // _Express_Entity_HeaderFile