Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:15:55

0001 // Copyright (c) 2017 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 _StdStorage_Root_HeaderFile
0015 #define _StdStorage_Root_HeaderFile
0016 
0017 #include <Standard.hxx>
0018 #include <Standard_Type.hxx>
0019 
0020 #include <TCollection_AsciiString.hxx>
0021 #include <Standard_Integer.hxx>
0022 #include <Standard_Transient.hxx>
0023 class StdObjMgt_Persistent;
0024 
0025 //! Describes a named persistent root
0026 class StdStorage_Root : public Standard_Transient
0027 {
0028   friend class StdStorage_RootData;
0029 
0030 public:
0031   DEFINE_STANDARD_RTTIEXT(StdStorage_Root, Standard_Transient)
0032 
0033   //! Creates an empty root
0034   Standard_EXPORT StdStorage_Root();
0035 
0036   //! Creates a root for writing
0037   Standard_EXPORT StdStorage_Root(const TCollection_AsciiString&           theName,
0038                                   const occ::handle<StdObjMgt_Persistent>& theObject);
0039 
0040   //! Returns a name of the root
0041   Standard_EXPORT TCollection_AsciiString Name() const;
0042 
0043   //! Sets a name to the root object
0044   Standard_EXPORT void SetName(const TCollection_AsciiString& theName);
0045 
0046   //! Returns a root's persistent object
0047   Standard_EXPORT occ::handle<StdObjMgt_Persistent> Object() const;
0048 
0049   //! Sets a root's persistent object
0050   Standard_EXPORT void SetObject(const occ::handle<StdObjMgt_Persistent>& anObject);
0051 
0052   //! Returns a root's persistent type
0053   Standard_EXPORT TCollection_AsciiString Type() const;
0054 
0055   //! Sets a root's persistent type
0056   Standard_EXPORT void SetType(const TCollection_AsciiString& aType);
0057 
0058   //! Returns root's position in the root data section
0059   Standard_EXPORT int Reference() const;
0060 
0061 private:
0062   Standard_EXPORT StdStorage_Root(const TCollection_AsciiString& theName,
0063                                   const int                      theRef,
0064                                   const TCollection_AsciiString& theType);
0065 
0066   Standard_EXPORT void SetReference(const int aRef);
0067 
0068   TCollection_AsciiString           myName;
0069   TCollection_AsciiString           myType;
0070   occ::handle<StdObjMgt_Persistent> myObject;
0071   int                               myRef;
0072 };
0073 
0074 #endif // _StdStorage_Root_HeaderFile