Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:59

0001 // Copyright (c) 2015 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 
0015 #ifndef _StdLPersistent_Dependency_HeaderFile
0016 #define _StdLPersistent_Dependency_HeaderFile
0017 
0018 #include <StdObjMgt_Attribute.hxx>
0019 #include <StdLPersistent_HString.hxx>
0020 #include <StdLPersistent_HArray1.hxx>
0021 
0022 #include <TDataStd_Relation.hxx>
0023 
0024 
0025 class StdLPersistent_Dependency
0026 {
0027   template <class AttribClass>
0028   class instance : public StdObjMgt_Attribute<AttribClass>
0029   {
0030   public:
0031     //! Read persistent data from a file.
0032     inline void Read (StdObjMgt_ReadData& theReadData)
0033       { theReadData >> myName >> myVariables; }
0034     //! Write persistent data to a file.
0035     inline void Write (StdObjMgt_WriteData& theWriteData) const
0036       { theWriteData << myName << myVariables; }
0037     //! Gets persistent child objects
0038     inline void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const
0039     {
0040       theChildren.Append(myName);
0041       theChildren.Append(myVariables);
0042     }
0043     //! Returns persistent type name
0044     Standard_CString PName() const;
0045 
0046     //! Import transient attribute from the persistent data.
0047     void Import (const Handle(AttribClass)& theAttribute) const;
0048 
0049   private:
0050     Handle(StdLPersistent_HString::Extended)   myName;
0051     Handle(StdLPersistent_HArray1::Persistent) myVariables;
0052   };
0053 
0054 public:
0055   typedef instance<TDataStd_Expression> Expression;
0056   typedef instance<TDataStd_Relation>   Relation;
0057 };
0058 
0059 template<>
0060 inline Standard_CString StdLPersistent_Dependency::instance<TDataStd_Expression>::PName() const
0061   { return "PDataStd_Expression"; }
0062 
0063 template<>
0064 inline Standard_CString StdLPersistent_Dependency::instance<TDataStd_Relation>::PName() const
0065   { return "PDataStd_Relation"; }
0066 
0067 #endif