1 // Created on: 2002-10-29
2 // Created by: Michael SAZONOV
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _BinMDF_ADriverTable_HeaderFile
17 #define _BinMDF_ADriverTable_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <BinMDF_TypeADriverMap.hxx>
23 #include <BinMDF_TypeIdMap.hxx>
24 #include <Standard_Transient.hxx>
25 #include <Standard_Type.hxx>
26 #include <Standard_Integer.hxx>
27 #include <TColStd_IndexedMapOfTransient.hxx>
28 #include <TColStd_SequenceOfAsciiString.hxx>
32 class BinMDF_ADriverTable;
33 DEFINE_STANDARD_HANDLE(BinMDF_ADriverTable, Standard_Transient)
35 //! A driver table is an object building links between
36 //! object types and object drivers. In the
37 //! translation process, a driver table is asked to
38 //! give a translation driver for each current object
40 class BinMDF_ADriverTable : public Standard_Transient
47 Standard_EXPORT BinMDF_ADriverTable();
49 //! Adds a translation driver <theDriver>.
50 Standard_EXPORT void AddDriver (const Handle(BinMDF_ADriver)& theDriver);
52 //! Assigns the IDs to the drivers of the given Types.
53 //! It uses indices in the map as IDs.
54 //! Useful in storage procedure.
55 Standard_EXPORT void AssignIds (const TColStd_IndexedMapOfTransient& theTypes);
57 //! Assigns the IDs to the drivers of the given Type Names;
58 //! It uses indices in the sequence as IDs.
59 //! Useful in retrieval procedure.
60 Standard_EXPORT void AssignIds (const TColStd_SequenceOfAsciiString& theTypeNames);
62 //! Gets a driver <theDriver> according to <theType>.
63 //! Returns Type ID if the driver was assigned an ID; 0 otherwise.
64 Standard_Integer GetDriver (const Handle(Standard_Type)& theType, Handle(BinMDF_ADriver)& theDriver) const;
66 //! Returns a driver according to <theTypeId>.
67 //! Returns null handle if a driver is not found
68 Handle(BinMDF_ADriver) GetDriver (const Standard_Integer theTypeId) const;
73 DEFINE_STANDARD_RTTIEXT(BinMDF_ADriverTable,Standard_Transient)
83 //! Assigns the ID to the driver of the Type
84 void AssignId (const Handle(Standard_Type)& theType, const Standard_Integer theId);
86 BinMDF_TypeADriverMap myMap;
87 BinMDF_TypeIdMap myMapId;
93 #include <BinMDF_ADriverTable.lxx>
99 #endif // _BinMDF_ADriverTable_HeaderFile