Warnings on vc14 were eliminated
[occt.git] / src / XmlMDF / XmlMDF_ADriverTable.cxx
1 // Created on: 2001-09-26
2 // Created by: Julia DOROVSKIKH
3 // Copyright (c) 2001-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16
17 #include <Standard_Type.hxx>
18 #include <XmlMDF_ADriver.hxx>
19 #include <XmlMDF_ADriverTable.hxx>
20
21 IMPLEMENT_STANDARD_RTTIEXT(XmlMDF_ADriverTable,MMgt_TShared)
22
23 //=======================================================================
24 //function : MDF_ADriverTable
25 //purpose  : 
26 //=======================================================================
27 XmlMDF_ADriverTable::XmlMDF_ADriverTable()
28 {}
29
30 //=======================================================================
31 //function : AddDriver
32 //purpose  : 
33 //=======================================================================
34 void XmlMDF_ADriverTable::AddDriver (const Handle(XmlMDF_ADriver)& anHDriver)
35 {
36   const Handle(Standard_Type)& type = anHDriver->SourceType();
37
38   // to make possible for applications to redefine standard attribute drivers
39   myMap.UnBind(type);
40
41   myMap.Bind(type,anHDriver);
42 }
43
44 //=======================================================================
45 //function : GetDrivers
46 //purpose  : 
47 //=======================================================================
48 const XmlMDF_TypeADriverMap& XmlMDF_ADriverTable::GetDrivers() const
49 {
50   return myMap;
51 }
52
53 //=======================================================================
54 //function : GetDriver
55 //purpose  : 
56 //=======================================================================
57 Standard_Boolean XmlMDF_ADriverTable::GetDriver
58   (const Handle(Standard_Type)& aType,
59    Handle(XmlMDF_ADriver)&      anHDriver) const
60 {
61   if (myMap.IsBound(aType))
62   {
63     anHDriver = myMap.Find(aType);
64     return Standard_True;
65   }
66   return Standard_False;
67 }