Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-17 08:29:22

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 <XmlMDF_MapOfDriver.hxx>
0026 
0027 #include <Message_ProgressRange.hxx>
0028 
0029 class TDF_Data;
0030 class XmlMDF_ADriverTable;
0031 class TDF_Label;
0032 class Message_Messenger;
0033 
0034 //! This package provides classes and methods to
0035 //! translate a transient DF into a persistent one and
0036 //! vice versa.
0037 //!
0038 //! Driver
0039 //!
0040 //! A driver is a tool used to translate a transient
0041 //! attribute into a persistent one and vice versa.
0042 //!
0043 //! Driver Table
0044 //!
0045 //! A driver table is an object building links between
0046 //! object types and object drivers. In the
0047 //! translation process, a driver table is asked to
0048 //! give a translation driver for each current object
0049 //! to be translated.
0050 class XmlMDF
0051 {
0052 public:
0053   DEFINE_STANDARD_ALLOC
0054 
0055   //! Translates a transient <aSource> into a persistent
0056   //! <aTarget>.
0057   Standard_EXPORT static void FromTo(
0058     const Handle(TDF_Data)&            aSource,
0059     XmlObjMgt_Element&                 aTarget,
0060     XmlObjMgt_SRelocationTable&        aReloc,
0061     const Handle(XmlMDF_ADriverTable)& aDrivers,
0062     const Message_ProgressRange&       theRange = Message_ProgressRange());
0063 
0064   //! Translates a persistent <aSource> into a transient
0065   //! <aTarget>.
0066   //! Returns True if completed successfully (False on error)
0067   Standard_EXPORT static Standard_Boolean FromTo(
0068     const XmlObjMgt_Element&           aSource,
0069     Handle(TDF_Data)&                  aTarget,
0070     XmlObjMgt_RRelocationTable&        aReloc,
0071     const Handle(XmlMDF_ADriverTable)& aDrivers,
0072     const Message_ProgressRange&       theRange = Message_ProgressRange());
0073 
0074   //! Adds the attribute storage drivers to <aDriverSeq>.
0075   Standard_EXPORT static void AddDrivers(const Handle(XmlMDF_ADriverTable)& aDriverTable,
0076                                          const Handle(Message_Messenger)&   theMessageDriver);
0077 
0078 private:
0079   Standard_EXPORT static Standard_Integer WriteSubTree(
0080     const TDF_Label&                   theLabel,
0081     XmlObjMgt_Element&                 theElement,
0082     XmlObjMgt_SRelocationTable&        aReloc,
0083     const Handle(XmlMDF_ADriverTable)& aDrivers,
0084     const Message_ProgressRange&       theRange = Message_ProgressRange());
0085 
0086   Standard_EXPORT static Standard_Integer ReadSubTree(
0087     const XmlObjMgt_Element&     theElement,
0088     const TDF_Label&             theLabel,
0089     XmlObjMgt_RRelocationTable&  aReloc,
0090     const XmlMDF_MapOfDriver&    aDrivers,
0091     const Message_ProgressRange& theRange = Message_ProgressRange());
0092 
0093   Standard_EXPORT static void CreateDrvMap(const Handle(XmlMDF_ADriverTable)& aDriverTable,
0094                                            XmlMDF_MapOfDriver&                anAsciiDriverMap);
0095 
0096   friend class XmlMDF_ADriver;
0097   friend class XmlMDF_TagSourceDriver;
0098   friend class XmlMDF_ReferenceDriver;
0099   friend class XmlMDF_ADriverTable;
0100 };
0101 
0102 #endif // _XmlMDF_HeaderFile