Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-25 09:21:13

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 #ifndef _StdLPersistent_Dependency_HeaderFile
0015 #define _StdLPersistent_Dependency_HeaderFile
0016 
0017 #include <StdObjMgt_Attribute.hxx>
0018 #include <StdLPersistent_HString.hxx>
0019 #include <StdLPersistent_HArray1.hxx>
0020 
0021 #include <TDataStd_Relation.hxx>
0022 
0023 class StdLPersistent_Dependency
0024 {
0025   template <class AttribClass>
0026   class instance : public StdObjMgt_Attribute<AttribClass>
0027   {
0028   public:
0029     //! Read persistent data from a file.
0030     inline void Read(StdObjMgt_ReadData& theReadData) { theReadData >> myName >> myVariables; }
0031 
0032     //! Write persistent data to a file.
0033     inline void Write(StdObjMgt_WriteData& theWriteData) const
0034     {
0035       theWriteData << myName << myVariables;
0036     }
0037 
0038     //! Gets persistent child objects
0039     inline void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const
0040     {
0041       theChildren.Append(myName);
0042       theChildren.Append(myVariables);
0043     }
0044 
0045     //! Returns persistent type name
0046     const char* PName() const;
0047 
0048     //! Import transient attribute from the persistent data.
0049     void Import(const occ::handle<AttribClass>& theAttribute) const;
0050 
0051   private:
0052     Handle(StdLPersistent_HString::Extended)   myName;
0053     Handle(StdLPersistent_HArray1::Persistent) myVariables;
0054   };
0055 
0056 public:
0057   typedef instance<TDataStd_Expression> Expression;
0058   typedef instance<TDataStd_Relation>   Relation;
0059 };
0060 
0061 template <>
0062 inline const char* StdLPersistent_Dependency::instance<TDataStd_Expression>::PName() const
0063 {
0064   return "PDataStd_Expression";
0065 }
0066 
0067 template <>
0068 inline const char* StdLPersistent_Dependency::instance<TDataStd_Relation>::PName() const
0069 {
0070   return "PDataStd_Relation";
0071 }
0072 
0073 #endif