1 // Created on: 2002-10-29
2 // Created by: Michael SAZONOV
3 // Copyright (c) 2002-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _BinMDF_ADriver_HeaderFile
17 #define _BinMDF_ADriver_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <TCollection_AsciiString.hxx>
23 #include <Standard_Transient.hxx>
24 #include <Standard_CString.hxx>
25 #include <Standard_Type.hxx>
26 #include <Standard_Boolean.hxx>
27 #include <BinObjMgt_RRelocationTable.hxx>
28 #include <BinObjMgt_SRelocationTable.hxx>
29 class Message_Messenger;
31 class BinObjMgt_Persistent;
35 DEFINE_STANDARD_HANDLE(BinMDF_ADriver, Standard_Transient)
37 //! Attribute Storage/Retrieval Driver.
38 class BinMDF_ADriver : public Standard_Transient
44 //! Creates a new attribute from TDF.
45 Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const = 0;
47 //! Returns the type of source object,
48 //! inheriting from Attribute from TDF.
49 Standard_EXPORT virtual const Handle(Standard_Type)& SourceType() const;
51 //! Returns the type name of the attribute object
52 const TCollection_AsciiString& TypeName() const;
54 //! Translate the contents of <aSource> and put it
55 //! into <aTarget>, using the relocation table
56 //! <aRelocTable> to keep the sharings.
57 Standard_EXPORT virtual Standard_Boolean Paste (const BinObjMgt_Persistent& aSource, const Handle(TDF_Attribute)& aTarget, BinObjMgt_RRelocationTable& aRelocTable) const = 0;
59 //! Translate the contents of <aSource> and put it
60 //! into <aTarget>, using the relocation table
61 //! <aRelocTable> to keep the sharings.
62 Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& aSource, BinObjMgt_Persistent& aTarget, BinObjMgt_SRelocationTable& aRelocTable) const = 0;
64 //! Returns the current message driver of this driver
65 const Handle(Message_Messenger)& MessageDriver() const { return myMessageDriver; }
67 DEFINE_STANDARD_RTTIEXT(BinMDF_ADriver,Standard_Transient)
72 Standard_EXPORT BinMDF_ADriver(const Handle(Message_Messenger)& theMsgDriver, const Standard_CString theName = NULL);
74 TCollection_AsciiString myTypeName;
76 Handle(Message_Messenger) myMessageDriver;
82 #include <BinMDF_ADriver.lxx>
88 #endif // _BinMDF_ADriver_HeaderFile