0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / BinMDF / BinMDF_ADriver.hxx
CommitLineData
42cf5bc1 1// Created on: 2002-10-29
2// Created by: Michael SAZONOV
3// Copyright (c) 2002-2014 OPEN CASCADE SAS
4//
5// This file is part of Open CASCADE Technology software library.
6//
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.
12//
13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
15
16#ifndef _BinMDF_ADriver_HeaderFile
17#define _BinMDF_ADriver_HeaderFile
18
19#include <Standard.hxx>
20#include <Standard_Type.hxx>
21
22#include <TCollection_AsciiString.hxx>
23#include <MMgt_TShared.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>
29class CDM_MessageDriver;
30class TDF_Attribute;
31class TCollection_AsciiString;
32class BinObjMgt_Persistent;
33class TCollection_ExtendedString;
34
35
36class BinMDF_ADriver;
37DEFINE_STANDARD_HANDLE(BinMDF_ADriver, MMgt_TShared)
38
39//! Attribute Storage/Retrieval Driver.
40class BinMDF_ADriver : public MMgt_TShared
41{
42
43public:
44
45
46 //! Creates a new attribute from TDF.
47 Standard_EXPORT virtual Handle(TDF_Attribute) NewEmpty() const = 0;
48
49 //! Returns the type of source object,
50 //! inheriting from Attribute from TDF.
51 const Handle(Standard_Type)& SourceType() const;
52
53 //! Returns the type name of the attribute object
54 const TCollection_AsciiString& TypeName() const;
55
56 //! Translate the contents of <aSource> and put it
57 //! into <aTarget>, using the relocation table
58 //! <aRelocTable> to keep the sharings.
59 Standard_EXPORT virtual Standard_Boolean Paste (const BinObjMgt_Persistent& aSource, const Handle(TDF_Attribute)& aTarget, BinObjMgt_RRelocationTable& aRelocTable) const = 0;
60
61 //! Translate the contents of <aSource> and put it
62 //! into <aTarget>, using the relocation table
63 //! <aRelocTable> to keep the sharings.
64 Standard_EXPORT virtual void Paste (const Handle(TDF_Attribute)& aSource, BinObjMgt_Persistent& aTarget, BinObjMgt_SRelocationTable& aRelocTable) const = 0;
65
66 //! Send message to Application (usually when error occurres)
67 Standard_EXPORT void WriteMessage (const TCollection_ExtendedString& theMessage) const;
68
69
70
71
92efcf78 72 DEFINE_STANDARD_RTTIEXT(BinMDF_ADriver,MMgt_TShared)
42cf5bc1 73
74protected:
75
76
77 Standard_EXPORT BinMDF_ADriver(const Handle(CDM_MessageDriver)& theMsgDriver, const Standard_CString theName = NULL);
78
79 TCollection_AsciiString myTypeName;
80
81
82private:
83
84
85 Handle(CDM_MessageDriver) myMessageDriver;
86
87
88};
89
90
91#include <BinMDF_ADriver.lxx>
92
93
94
95
96
97#endif // _BinMDF_ADriver_HeaderFile