Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-15 09:17:41

0001 // Created on: 2001-07-09
0002 // Created by: Julia DOROVSKIKH
0003 // Copyright (c) 2001-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _XmlMDF_HeaderFile
0017 #define _XmlMDF_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <XmlObjMgt_Element.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <TCollection_AsciiString.hxx>
0026 #include <XmlMDF_ADriver.hxx>
0027 #include <NCollection_DataMap.hxx>
0028 
0029 #include <Message_ProgressRange.hxx>
0030 
0031 class TDF_Data;
0032 class XmlMDF_ADriverTable;
0033 class TDF_Label;
0034 class Message_Messenger;
0035 
0036 //! This package provides classes and methods to
0037 //! translate a transient DF into a persistent one and
0038 //! vice versa.
0039 //!
0040 //! Driver
0041 //!
0042 //! A driver is a tool used to translate a transient
0043 //! attribute into a persistent one and vice versa.
0044 //!
0045 //! Driver Table
0046 //!
0047 //! A driver table is an object building links between
0048 //! object types and object drivers. In the
0049 //! translation process, a driver table is asked to
0050 //! give a translation driver for each current object
0051 //! to be translated.
0052 class XmlMDF
0053 {
0054 public:
0055   DEFINE_STANDARD_ALLOC
0056 
0057   //! Translates a transient <aSource> into a persistent
0058   //! <aTarget>.
0059   Standard_EXPORT static void FromTo(
0060     const occ::handle<TDF_Data>&            aSource,
0061     XmlObjMgt_Element&                      aTarget,
0062     XmlObjMgt_SRelocationTable&             aReloc,
0063     const occ::handle<XmlMDF_ADriverTable>& aDrivers,
0064     const Message_ProgressRange&            theRange = Message_ProgressRange());
0065 
0066   //! Translates a persistent <aSource> into a transient
0067   //! <aTarget>.
0068   //! Returns True if completed successfully (False on error)
0069   Standard_EXPORT static bool FromTo(
0070     const XmlObjMgt_Element&                aSource,
0071     occ::handle<TDF_Data>&                  aTarget,
0072     XmlObjMgt_RRelocationTable&             aReloc,
0073     const occ::handle<XmlMDF_ADriverTable>& aDrivers,
0074     const Message_ProgressRange&            theRange = Message_ProgressRange());
0075 
0076   //! Adds the attribute storage drivers to <aDriverSeq>.
0077   Standard_EXPORT static void AddDrivers(const occ::handle<XmlMDF_ADriverTable>& aDriverTable,
0078                                          const occ::handle<Message_Messenger>&   theMessageDriver);
0079 
0080 private:
0081   Standard_EXPORT static int WriteSubTree(
0082     const TDF_Label&                        theLabel,
0083     XmlObjMgt_Element&                      theElement,
0084     XmlObjMgt_SRelocationTable&             aReloc,
0085     const occ::handle<XmlMDF_ADriverTable>& aDrivers,
0086     const Message_ProgressRange&            theRange = Message_ProgressRange());
0087 
0088   Standard_EXPORT static int ReadSubTree(
0089     const XmlObjMgt_Element&                                                         theElement,
0090     const TDF_Label&                                                                 theLabel,
0091     XmlObjMgt_RRelocationTable&                                                      aReloc,
0092     const NCollection_DataMap<TCollection_AsciiString, occ::handle<XmlMDF_ADriver>>& aDrivers,
0093     const Message_ProgressRange& theRange = Message_ProgressRange());
0094 
0095   Standard_EXPORT static void CreateDrvMap(
0096     const occ::handle<XmlMDF_ADriverTable>&                                    aDriverTable,
0097     NCollection_DataMap<TCollection_AsciiString, occ::handle<XmlMDF_ADriver>>& anAsciiDriverMap);
0098 
0099   friend class XmlMDF_ADriver;
0100   friend class XmlMDF_TagSourceDriver;
0101   friend class XmlMDF_ReferenceDriver;
0102   friend class XmlMDF_ADriverTable;
0103 };
0104 
0105 #endif // _XmlMDF_HeaderFile