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 //=======================================================================
18 //purpose : Assigns the ID to the driver of the Type
19 //=======================================================================
21 inline void BinMDF_ADriverTable::AssignId
22 (const Handle(Standard_Type)& theType,
23 const Standard_Integer theId)
25 myMapId.Bind (theType, theId);
28 //=======================================================================
29 //function : GetDriver
30 //purpose : Gets a driver <theDriver> according to <theType>.
31 // Returns Type ID if the driver was assigned an ID; 0 otherwise.
32 //=======================================================================
34 inline Standard_Integer BinMDF_ADriverTable::GetDriver
35 (const Handle(Standard_Type)& theType,
36 Handle(BinMDF_ADriver)& theDriver) const
38 Standard_Integer anId = 0;
39 if (myMap.IsBound(theType)) {
40 theDriver = myMap (theType);
41 if (myMapId.IsBound1(theType))
42 anId = myMapId.Find1 (theType);
47 //=======================================================================
48 //function : GetDriver
49 //purpose : Returns a driver according to <theTypeId>.
50 // Returns null handle if a driver is not found
51 //=======================================================================
53 inline Handle(BinMDF_ADriver) BinMDF_ADriverTable::GetDriver
54 (const Standard_Integer theTypeId) const
56 Handle(BinMDF_ADriver) aDriver;
57 if (myMapId.IsBound2(theTypeId)) {
58 const Handle(Standard_Type)& aType = myMapId.Find2 (theTypeId);
59 aDriver = myMap (aType);