0027111: Add generalized copy constructor in handle class for old compilers
[occt.git] / src / XmlTObjDrivers / XmlTObjDrivers.cxx
CommitLineData
b311480e 1// Created on: 2004-11-24
2// Created by: Michael SAZONOV
973c2be1 3// Copyright (c) 2004-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.
b311480e 15
7fd59977 16// The original implementation Copyright: (C) RINA S.p.A
17
18#include <XmlLDrivers.hxx>
19#include <XmlTObjDrivers.hxx>
20#include <XmlMDF_ADriverTable.hxx>
21#include <XmlTObjDrivers_DocumentStorageDriver.hxx>
22#include <XmlTObjDrivers_DocumentRetrievalDriver.hxx>
23#include <XmlTObjDrivers_ModelDriver.hxx>
24#include <XmlTObjDrivers_ObjectDriver.hxx>
25#include <XmlTObjDrivers_ReferenceDriver.hxx>
26#include <XmlTObjDrivers_XYZDriver.hxx>
27#include <XmlTObjDrivers_IntSparseArrayDriver.hxx>
28
29#include <Plugin_Macro.hxx>
30
7fd59977 31static Standard_GUID XmlStorageDriver ("f78ff4a0-a779-11d5-aab4-0050044b1af1");
32static Standard_GUID XmlRetrievalDriver("f78ff4a1-a779-11d5-aab4-0050044b1af1");
33
ce8b059a 34const Handle(Standard_Transient)& XmlTObjDrivers::Factory(const Standard_GUID& aGUID)
7fd59977 35{
36 if(aGUID == XmlStorageDriver)
37 {
0797d9d3 38#ifdef OCCT_DEBUG
7fd59977 39 cout << "XmlTObjDrivers : Storage Plugin" << endl;
63c629aa 40#endif
4796758e 41 static Handle(Standard_Transient) model_sd
7fd59977 42 = new XmlTObjDrivers_DocumentStorageDriver
43 ("Copyright: Open CASCADE 2004"); // default copyright
44 return model_sd;
45 }
46
47 if(aGUID == XmlRetrievalDriver)
48 {
0797d9d3 49#ifdef OCCT_DEBUG
7fd59977 50 cout << "XmlTObjDrivers : Retrieval Plugin" << endl;
63c629aa 51#endif
4796758e 52 static Handle (Standard_Transient) model_rd
7fd59977 53 = new XmlTObjDrivers_DocumentRetrievalDriver;
54 return model_rd;
55 }
56
57 return XmlLDrivers::Factory (aGUID);
58}
59
60//=======================================================================
61//function : AddDrivers
62//purpose :
63//=======================================================================
64void XmlTObjDrivers::AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable,
65 const Handle(CDM_MessageDriver)& anMsgDrv)
66{
67 aDriverTable -> AddDriver (new XmlTObjDrivers_ModelDriver (anMsgDrv));
68 aDriverTable -> AddDriver (new XmlTObjDrivers_ObjectDriver (anMsgDrv));
69 aDriverTable -> AddDriver (new XmlTObjDrivers_ReferenceDriver (anMsgDrv));
70 aDriverTable -> AddDriver (new XmlTObjDrivers_XYZDriver (anMsgDrv));
71 aDriverTable -> AddDriver (new XmlTObjDrivers_IntSparseArrayDriver(anMsgDrv));
72}
73
74PLUGIN(XmlTObjDrivers)