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_Schema_HeaderFile
0015 #define _Express_Schema_HeaderFile
0016 
0017 #include <Express_DataMapOfAsciiStringItem.hxx>
0018 #include <Express_HSequenceOfItem.hxx>
0019 #include <Standard_Type.hxx>
0020 
0021 class TCollection_HAsciiString;
0022 class Express_HSequenceOfItem;
0023 class Express_Item;
0024 class TCollection_AsciiString;
0025 class Express_Type;
0026 
0027 //! Represents a schema as a list of items and provides general
0028 //! tools for generating HXX/CXX files (including dictionary of
0029 //! item names)
0030 class Express_Schema : public Standard_Transient
0031 {
0032 
0033 public:
0034 
0035   //! Creates a schema with given name and given set of items
0036   //! and calls Prepare()
0037   Standard_EXPORT Express_Schema (const Standard_CString theName,
0038                                   const Handle(Express_HSequenceOfItem)& theItems);
0039 
0040   //! Creates a schema with given name and given set of items
0041   //! and calls Prepare()
0042   Standard_EXPORT Express_Schema (const Handle(TCollection_HAsciiString)& theName,
0043                                   const Handle(Express_HSequenceOfItem)& theItems);
0044 
0045   //! Returns schema name
0046   Standard_EXPORT const Handle(TCollection_HAsciiString)& Name() const;
0047 
0048   //! Returns sequence of items
0049   Standard_EXPORT const Handle(Express_HSequenceOfItem)& Items() const;
0050 
0051   //! Returns number of items
0052   Standard_EXPORT Standard_Integer NbItems() const;
0053 
0054   //! Returns item by index
0055   Standard_EXPORT Handle(Express_Item) Item (const Standard_Integer theNum) const;
0056 
0057   //! Returns item by name
0058   Standard_EXPORT Handle(Express_Item) Item (const Standard_CString theName,
0059                                              const Standard_Boolean theSilent = Standard_False) const;
0060 
0061   //! Returns item by name
0062   Standard_EXPORT Handle(Express_Item) Item (const TCollection_AsciiString& theName) const;
0063 
0064   //! Returns item by name
0065   Standard_EXPORT Handle(Express_Item) Item (const Handle(TCollection_HAsciiString)& theName) const;
0066 
0067   DEFINE_STANDARD_RTTIEXT(Express_Schema, Standard_Transient)
0068 
0069 protected:
0070 
0071 private:
0072 
0073   //! Prepares data for further work. Converts all item names
0074   //! from EXPRESS style (aaa_bb) to CASCADE style (AaaBb).
0075   //! Then, makes a dictionary of item names and sets handles
0076   //! to all items referred initially by name
0077   Standard_EXPORT void Prepare();
0078 
0079   //! Prepares type for work by setting its handle to item in the
0080   //! schema according to dictionary (for types which refer items
0081   //! by name)
0082   Standard_EXPORT void PrepareType (const Handle(Express_Type)& theType) const;
0083 
0084 private:
0085 
0086   Handle(TCollection_HAsciiString) myName;
0087   Handle(Express_HSequenceOfItem) myItems;
0088   Express_DataMapOfAsciiStringItem myDict;
0089 
0090 };
0091 
0092 #endif // _Express_Schema_HeaderFile