0032751: Coding - get rid of unused headers [AppStd to BndLib]
[occt.git] / src / BinDrivers / BinDrivers.cxx
CommitLineData
b311480e 1// Created on: 2002-10-29
2// Created by: Michael SAZONOV
973c2be1 3// Copyright (c) 2002-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 <BinDrivers.hxx>
18#include <BinDrivers_DocumentRetrievalDriver.hxx>
19#include <BinDrivers_DocumentStorageDriver.hxx>
7fd59977 20#include <BinLDrivers.hxx>
7fd59977 21#include <BinMDataStd.hxx>
22#include <BinMDataXtd.hxx>
42cf5bc1 23#include <BinMDF.hxx>
24#include <BinMDF_ADriverTable.hxx>
7fd59977 25#include <BinMDocStd.hxx>
26#include <BinMFunction.hxx>
42cf5bc1 27#include <BinMNaming.hxx>
7fd59977 28#include <Plugin_Macro.hxx>
42cf5bc1 29#include <Standard_Failure.hxx>
30#include <Standard_GUID.hxx>
31#include <Standard_Transient.hxx>
6fe96f84 32#include <TDocStd_Application.hxx>
7fd59977 33
7fd59977 34static Standard_GUID BinStorageDriver ("03a56835-8269-11d5-aab2-0050044b1af1");
35static Standard_GUID BinRetrievalDriver("03a56836-8269-11d5-aab2-0050044b1af1");
36
37//=======================================================================
38//function : Factory
39//purpose : PLUGIN FACTORY
40//=======================================================================
ce8b059a 41const Handle(Standard_Transient)& BinDrivers::Factory(const Standard_GUID& theGUID)
7fd59977 42{
43 if (theGUID == BinStorageDriver)
44 {
0797d9d3 45#ifdef OCCT_DEBUG
04232180 46 std::cout << "BinDrivers : Storage Plugin" << std::endl;
63c629aa 47#endif
4796758e 48 static Handle(Standard_Transient) model_sd =
7fd59977 49 new BinDrivers_DocumentStorageDriver;
50 return model_sd;
51 }
52
53 if (theGUID == BinRetrievalDriver)
54 {
0797d9d3 55#ifdef OCCT_DEBUG
04232180 56 std::cout << "BinDrivers : Retrieval Plugin" << std::endl;
63c629aa 57#endif
4796758e 58 static Handle(Standard_Transient) model_rd =
7fd59977 59 new BinDrivers_DocumentRetrievalDriver;
60 return model_rd;
61 }
62
9775fa61 63 throw Standard_Failure("BinDrivers : unknown GUID");
7fd59977 64}
65
6fe96f84 66//=======================================================================
67//function : DefineFormat
68//purpose :
69//=======================================================================
70void BinDrivers::DefineFormat (const Handle(TDocStd_Application)& theApp)
71{
72 theApp->DefineFormat ("BinOcaf", "Binary OCAF Document", "cbf",
73 new BinDrivers_DocumentRetrievalDriver,
74 new BinDrivers_DocumentStorageDriver);
75}
76
7fd59977 77//=======================================================================
78//function : AttributeDrivers
79//purpose :
80//=======================================================================
81
82Handle(BinMDF_ADriverTable) BinDrivers::AttributeDrivers
83ae3591 83 (const Handle(Message_Messenger)& aMsgDrv)
7fd59977 84{
85 Handle(BinMDF_ADriverTable) aTable = new BinMDF_ADriverTable;
86
87 BinMDF ::AddDrivers (aTable, aMsgDrv);
88 BinMDataStd ::AddDrivers (aTable, aMsgDrv);
89 BinMDataXtd ::AddDrivers (aTable, aMsgDrv);
90 BinMNaming ::AddDrivers (aTable, aMsgDrv);
91 BinMDocStd ::AddDrivers (aTable, aMsgDrv);
92 BinMFunction ::AddDrivers (aTable, aMsgDrv);
7fd59977 93 return aTable;
94}
95
7fd59977 96PLUGIN(BinDrivers)