1 // Created on: 1999-08-04
2 // Created by: Denis PASCAL
3 // Copyright (c) 1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _TPrsStd_DriverTable_HeaderFile
18 #define _TPrsStd_DriverTable_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <TPrsStd_DataMapOfGUIDDriver.hxx>
24 #include <Standard_Transient.hxx>
25 #include <Standard_Boolean.hxx>
30 class TPrsStd_DriverTable;
31 DEFINE_STANDARD_HANDLE(TPrsStd_DriverTable, Standard_Transient)
33 //! This class is a container to record (AddDriver)
34 //! binding between GUID and TPrsStd_Driver.
35 //! You create a new instance of TPrsStd_Driver
36 //! and use the method AddDriver to load it into the driver table. the method
37 class TPrsStd_DriverTable : public Standard_Transient
43 //! Returns the static table.
44 //! If it does not exist, creates it and fills it with standard drivers.
45 Standard_EXPORT static Handle(TPrsStd_DriverTable) Get();
47 //! Default constructor
48 Standard_EXPORT TPrsStd_DriverTable();
50 //! Fills the table with standard drivers
51 Standard_EXPORT void InitStandardDrivers();
53 //! Returns true if the driver has been added successfully to the driver table.
54 Standard_EXPORT Standard_Boolean AddDriver (const Standard_GUID& guid, const Handle(TPrsStd_Driver)& driver);
56 //! Returns true if the driver was found.
57 Standard_EXPORT Standard_Boolean FindDriver (const Standard_GUID& guid, Handle(TPrsStd_Driver)& driver) const;
60 //! Removes a driver with the given GUID.
61 //! Returns true if the driver has been removed successfully.
62 Standard_EXPORT Standard_Boolean RemoveDriver (const Standard_GUID& guid);
64 //! Removes all drivers. Returns
65 //! true if the driver has been removed successfully.
66 //! If this method is used, the InitStandardDrivers method should be
67 //! called to fill the table with standard drivers.
68 Standard_EXPORT void Clear();
73 DEFINE_STANDARD_RTTIEXT(TPrsStd_DriverTable,Standard_Transient)
83 TPrsStd_DataMapOfGUIDDriver myDrivers;
94 #endif // _TPrsStd_DriverTable_HeaderFile