0030675: Visualization - remove redundant proxy classes in hierarchy of PrsMgr_Presen...
[occt.git] / src / XmlMDF / XmlMDF_ADriverTable.cxx
CommitLineData
b311480e 1// Created on: 2001-09-26
2// Created by: Julia DOROVSKIKH
973c2be1 3// Copyright (c) 2001-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 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
973c2be1 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
7fd59977 15
42cf5bc1 16
17#include <Standard_Type.hxx>
18#include <XmlMDF_ADriver.hxx>
19#include <XmlMDF_ADriverTable.hxx>
7fd59977 20
25e59720 21IMPLEMENT_STANDARD_RTTIEXT(XmlMDF_ADriverTable,Standard_Transient)
92efcf78 22
7fd59977 23//=======================================================================
24//function : MDF_ADriverTable
25//purpose :
26//=======================================================================
27XmlMDF_ADriverTable::XmlMDF_ADriverTable()
28{}
29
30//=======================================================================
31//function : AddDriver
32//purpose :
33//=======================================================================
34void 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//=======================================================================
48const XmlMDF_TypeADriverMap& XmlMDF_ADriverTable::GetDrivers() const
49{
50 return myMap;
51}
52
53//=======================================================================
54//function : GetDriver
55//purpose :
56//=======================================================================
57Standard_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}