Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/XmlMDF_ADriverTable.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Created on: 2001-09-26
0002 // Created by: Julia DOROVSKIKH
0003 // Copyright (c) 2001-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _XmlMDF_ADriverTable_HeaderFile
0017 #define _XmlMDF_ADriverTable_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <Standard_Type.hxx>
0022 #include <XmlMDF_ADriver.hxx>
0023 #include <NCollection_DataMap.hxx>
0024 #include <Standard_Transient.hxx>
0025 #include <Standard_Boolean.hxx>
0026 #include <TCollection_AsciiString.hxx>
0027 class XmlMDF_ADriver;
0028 
0029 //! A driver table is an object building links between
0030 //! object types and object drivers. In the
0031 //! translation process, a driver table is asked to
0032 //! give a translation driver for each current object
0033 //! to be translated.
0034 class XmlMDF_ADriverTable : public Standard_Transient
0035 {
0036 
0037 public:
0038   //! Creates a mutable ADriverTable from XmlMDF.
0039   Standard_EXPORT XmlMDF_ADriverTable();
0040 
0041   //! Sets a translation driver: <aDriver>.
0042   Standard_EXPORT void AddDriver(const occ::handle<XmlMDF_ADriver>& anHDriver);
0043 
0044   //! Adds a translation driver for the derived attribute. The base driver must be already added.
0045   //! @param theInstance is newly created attribute, detached from any label
0046   Standard_EXPORT void AddDerivedDriver(const occ::handle<TDF_Attribute>& theInstance);
0047 
0048   //! Adds a translation driver for the derived attribute. The base driver must be already added.
0049   //! @param theDerivedType is registered attribute type using IMPLEMENT_DERIVED_ATTRIBUTE macro
0050   Standard_EXPORT const occ::handle<Standard_Type>& AddDerivedDriver(const char* theDerivedType);
0051 
0052   //! Fills the map by all registered drivers.
0053   Standard_EXPORT void CreateDrvMap(
0054     NCollection_DataMap<TCollection_AsciiString, occ::handle<XmlMDF_ADriver>>& theDriverMap);
0055 
0056   //! Gets a driver <aDriver> according to <aType>
0057   //!
0058   //! Returns True if a driver is found; false otherwise.
0059   Standard_EXPORT bool GetDriver(const occ::handle<Standard_Type>& theType,
0060                                  occ::handle<XmlMDF_ADriver>&      theDriver);
0061 
0062   DEFINE_STANDARD_RTTIEXT(XmlMDF_ADriverTable, Standard_Transient)
0063 
0064 private:
0065   NCollection_DataMap<occ::handle<Standard_Type>, occ::handle<XmlMDF_ADriver>> myMap;
0066 };
0067 
0068 #endif // _XmlMDF_ADriverTable_HeaderFile