Back to home page

EIC code displayed by LXR

 
 

    


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

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 DEFINE_STANDARD_HANDLE(StdStorage_Root, Standard_Transient)
0026 
0027 //! Describes a named persistent root 
0028 class StdStorage_Root
0029   : public Standard_Transient
0030 {
0031   friend class StdStorage_RootData;
0032 
0033 public:
0034 
0035   DEFINE_STANDARD_RTTIEXT(StdStorage_Root, Standard_Transient)
0036 
0037   //! Creates an empty root
0038   Standard_EXPORT StdStorage_Root();
0039 
0040   //! Creates a root for writing
0041   Standard_EXPORT StdStorage_Root(const TCollection_AsciiString&      theName,
0042                                   const Handle(StdObjMgt_Persistent)& theObject);
0043 
0044   //! Returns a name of the root
0045   Standard_EXPORT TCollection_AsciiString Name() const;
0046 
0047   //! Sets a name to the root object
0048   Standard_EXPORT void SetName(const TCollection_AsciiString& theName);
0049 
0050   //! Returns a root's persistent object
0051   Standard_EXPORT Handle(StdObjMgt_Persistent) Object() const;
0052 
0053   //! Sets a root's persistent object
0054   Standard_EXPORT void SetObject(const Handle(StdObjMgt_Persistent)& anObject);
0055 
0056   //! Returns a root's persistent type
0057   Standard_EXPORT TCollection_AsciiString Type() const;
0058 
0059   //! Sets a root's persistent type
0060   Standard_EXPORT void SetType(const TCollection_AsciiString& aType);
0061 
0062   //! Returns root's position in the root data section
0063   Standard_EXPORT Standard_Integer Reference() const;
0064 
0065 private:
0066 
0067   Standard_EXPORT StdStorage_Root(const TCollection_AsciiString& theName,
0068                                   const Standard_Integer         theRef,
0069                                   const TCollection_AsciiString& theType);
0070 
0071   Standard_EXPORT void SetReference(const Standard_Integer aRef);
0072 
0073   TCollection_AsciiString myName;
0074   TCollection_AsciiString myType;
0075   Handle(StdObjMgt_Persistent) myObject;
0076   Standard_Integer myRef;
0077 
0078 };
0079 
0080 #endif // _StdStorage_Root_HeaderFile