Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:00

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 _StdObject_Location_HeaderFile
0016 #define _StdObject_Location_HeaderFile
0017 
0018 #include <StdObjMgt_ReadData.hxx>
0019 #include <StdObjMgt_WriteData.hxx>
0020 #include <StdObjMgt_Persistent.hxx>
0021 #include <StdObjMgt_TransientPersistentMap.hxx>
0022 
0023 #include <TopLoc_Location.hxx>
0024 
0025 class StdObject_Location
0026 {
0027 public:
0028 
0029   //! Gets persistent child objects
0030   Standard_EXPORT void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const;
0031 
0032   //! Import transient object from the persistent data.
0033   TopLoc_Location Import() const;
0034 
0035   //! Creates a persistent wrapper object for a location
0036   Standard_EXPORT static StdObject_Location Translate (const TopLoc_Location& theLoc,
0037                                                        StdObjMgt_TransientPersistentMap& theMap);
0038 
0039 private:
0040   Handle(StdObjMgt_Persistent) myData;
0041 
0042   friend StdObjMgt_ReadData& operator >>
0043     (StdObjMgt_ReadData&, StdObject_Location&);
0044   friend StdObjMgt_WriteData& operator <<
0045     (StdObjMgt_WriteData&, const StdObject_Location&);
0046 };
0047 
0048 //! Read persistent data from a file.
0049 inline StdObjMgt_ReadData& operator >>
0050   (StdObjMgt_ReadData& theReadData, StdObject_Location& theLocation)
0051 {
0052   StdObjMgt_ReadData::ObjectSentry aSentry (theReadData);
0053   return theReadData >> theLocation.myData;
0054 }
0055 
0056 //! Write persistent data to a file.
0057 inline StdObjMgt_WriteData& operator <<
0058   (StdObjMgt_WriteData& theWriteData, const StdObject_Location& theLocation)
0059 {
0060   StdObjMgt_WriteData::ObjectSentry aSentry (theWriteData);
0061   return theWriteData << theLocation.myData;
0062 }
0063 
0064 #endif