42cf5bc1 |
1 | // Created on: 2001-07-09 |
2 | // Created by: Julia DOROVSKIKH |
3 | // Copyright (c) 2001-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 _XmlMDF_HeaderFile |
17 | #define _XmlMDF_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_DefineAlloc.hxx> |
21 | #include <Standard_Handle.hxx> |
22 | |
23 | #include <XmlObjMgt_Element.hxx> |
24 | #include <XmlObjMgt_SRelocationTable.hxx> |
25 | #include <Standard_Integer.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <XmlObjMgt_RRelocationTable.hxx> |
28 | #include <XmlMDF_MapOfDriver.hxx> |
29 | class TDF_Data; |
30 | class XmlMDF_ADriverTable; |
31 | class TDF_Label; |
83ae3591 |
32 | class Message_Messenger; |
42cf5bc1 |
33 | class XmlMDF_ADriver; |
34 | class XmlMDF_TagSourceDriver; |
35 | class XmlMDF_ReferenceDriver; |
36 | class XmlMDF_ADriverTable; |
37 | |
38 | |
39 | //! This package provides classes and methods to |
40 | //! translate a transient DF into a persistent one and |
41 | //! vice versa. |
42 | //! |
43 | //! Driver |
44 | //! |
45 | //! A driver is a tool used to translate a transient |
46 | //! attribute into a persistent one and vice versa. |
47 | //! |
48 | //! Driver Table |
49 | //! |
50 | //! A driver table is an object building links between |
51 | //! object types and object drivers. In the |
52 | //! translation process, a driver table is asked to |
53 | //! give a translation driver for each current object |
54 | //! to be translated. |
55 | class XmlMDF |
56 | { |
57 | public: |
58 | |
59 | DEFINE_STANDARD_ALLOC |
60 | |
61 | |
62 | //! Translates a transient <aSource> into a persistent |
63 | //! <aTarget>. |
64 | Standard_EXPORT static void FromTo (const Handle(TDF_Data)& aSource, XmlObjMgt_Element& aTarget, XmlObjMgt_SRelocationTable& aReloc, const Handle(XmlMDF_ADriverTable)& aDrivers); |
65 | |
66 | //! Translates a persistent <aSource> into a transient |
67 | //! <aTarget>. |
68 | //! Returns True if completed successfully (False on error) |
69 | Standard_EXPORT static Standard_Boolean FromTo (const XmlObjMgt_Element& aSource, Handle(TDF_Data)& aTarget, XmlObjMgt_RRelocationTable& aReloc, const Handle(XmlMDF_ADriverTable)& aDrivers); |
70 | |
71 | //! Adds the attribute storage drivers to <aDriverSeq>. |
83ae3591 |
72 | Standard_EXPORT static void AddDrivers (const Handle(XmlMDF_ADriverTable)& aDriverTable, const Handle(Message_Messenger)& theMessageDriver); |
42cf5bc1 |
73 | |
74 | |
75 | |
76 | |
77 | protected: |
78 | |
79 | |
80 | |
81 | |
82 | |
83 | private: |
84 | |
85 | |
86 | Standard_EXPORT static Standard_Integer WriteSubTree (const TDF_Label& theLabel, XmlObjMgt_Element& theElement, XmlObjMgt_SRelocationTable& aReloc, const Handle(XmlMDF_ADriverTable)& aDrivers); |
87 | |
88 | Standard_EXPORT static Standard_Integer ReadSubTree (const XmlObjMgt_Element& theElement, const TDF_Label& theLabel, XmlObjMgt_RRelocationTable& aReloc, const XmlMDF_MapOfDriver& aDrivers); |
89 | |
90 | Standard_EXPORT static void CreateDrvMap (const Handle(XmlMDF_ADriverTable)& aDriverTable, XmlMDF_MapOfDriver& anAsciiDriverMap); |
91 | |
92 | |
93 | |
94 | friend class XmlMDF_ADriver; |
95 | friend class XmlMDF_TagSourceDriver; |
96 | friend class XmlMDF_ReferenceDriver; |
97 | friend class XmlMDF_ADriverTable; |
98 | |
99 | }; |
100 | |
101 | |
102 | |
103 | |
104 | |
105 | |
106 | |
107 | #endif // _XmlMDF_HeaderFile |