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_Real_HeaderFile
0016 #define _StdLPersistent_Real_HeaderFile
0017 
0018 #include <StdObjMgt_Attribute.hxx>
0019 
0020 #include <TDataStd_Real.hxx>
0021 
0022 
0023 class StdLPersistent_Real : public StdObjMgt_Attribute<TDataStd_Real>
0024 {
0025 public:
0026   //! Empty constructor.
0027   StdLPersistent_Real()
0028   : myValue(0.0),
0029     myDimension(0)
0030   {
0031   }
0032   //! Read persistent data from a file.
0033   inline void Read (StdObjMgt_ReadData& theReadData)
0034     { theReadData >> myValue >> myDimension; }
0035   //! Write persistent data from a file.
0036   inline void Write (StdObjMgt_WriteData& theWriteData) const
0037     { theWriteData << myValue << myDimension; }
0038   //! Gets persistent child objects
0039   void PChildren(StdObjMgt_Persistent::SequenceOfPersistent&) const {}
0040   //! Returns persistent type name
0041   Standard_CString PName() const { return "PDataStd_Real"; }
0042 
0043   //! Import transient attribute from the persistent data.
0044   void Import (const Handle(TDataStd_Real)& theAttribute) const
0045   {
0046     theAttribute->Set (myValue);
0047     Standard_DISABLE_DEPRECATION_WARNINGS
0048     theAttribute->SetDimension (static_cast<TDataStd_RealEnum> (myDimension));
0049     Standard_ENABLE_DEPRECATION_WARNINGS
0050     theAttribute->SetID (TDataStd_Real::GetID());
0051   }
0052 
0053 private:
0054   Standard_Real    myValue;
0055   Standard_Integer myDimension;
0056 };
0057 
0058 #endif