ec964372 |
1 | // Copyright (c) 2017 OPEN CASCADE SAS |
2 | // |
3 | // This file is part of Open CASCADE Technology software library. |
4 | // |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
10 | // |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
13 | |
14 | #ifndef _StdStorage_Root_HeaderFile |
15 | #define _StdStorage_Root_HeaderFile |
16 | |
17 | #include <Standard.hxx> |
18 | #include <Standard_Type.hxx> |
19 | |
20 | #include <TCollection_AsciiString.hxx> |
21 | #include <Standard_Integer.hxx> |
25e59720 |
22 | #include <Standard_Transient.hxx> |
ec964372 |
23 | class StdObjMgt_Persistent; |
24 | class Storage_Schema; |
25 | class TCollection_AsciiString; |
26 | |
27 | class Storage_Root; |
25e59720 |
28 | DEFINE_STANDARD_HANDLE(StdStorage_Root, Standard_Transient) |
ec964372 |
29 | |
30 | //! Describes a named persistent root |
31 | class StdStorage_Root |
25e59720 |
32 | : public Standard_Transient |
ec964372 |
33 | { |
34 | friend class StdStorage_RootData; |
35 | |
36 | public: |
37 | |
25e59720 |
38 | DEFINE_STANDARD_RTTIEXT(StdStorage_Root, Standard_Transient) |
ec964372 |
39 | |
40 | //! Creates an empty root |
41 | Standard_EXPORT StdStorage_Root(); |
42 | |
43 | //! Creates a root for writing |
44 | Standard_EXPORT StdStorage_Root(const TCollection_AsciiString& theName, |
45 | const Handle(StdObjMgt_Persistent)& theObject); |
46 | |
47 | //! Returns a name of the root |
48 | Standard_EXPORT TCollection_AsciiString Name() const; |
49 | |
50 | //! Sets a name to the root object |
51 | Standard_EXPORT void SetName(const TCollection_AsciiString& theName); |
52 | |
53 | //! Returns a root's persistent object |
54 | Standard_EXPORT Handle(StdObjMgt_Persistent) Object() const; |
55 | |
56 | //! Sets a root's persistent object |
57 | Standard_EXPORT void SetObject(const Handle(StdObjMgt_Persistent)& anObject); |
58 | |
59 | //! Returns a root's persistent type |
60 | Standard_EXPORT TCollection_AsciiString Type() const; |
61 | |
62 | //! Sets a root's persistent type |
63 | Standard_EXPORT void SetType(const TCollection_AsciiString& aType); |
64 | |
65 | //! Returns root's position in the root data section |
66 | Standard_EXPORT Standard_Integer Reference() const; |
67 | |
68 | private: |
69 | |
70 | Standard_EXPORT StdStorage_Root(const TCollection_AsciiString& theName, |
71 | const Standard_Integer theRef, |
72 | const TCollection_AsciiString& theType); |
73 | |
74 | Standard_EXPORT void SetReference(const Standard_Integer aRef); |
75 | |
76 | TCollection_AsciiString myName; |
77 | TCollection_AsciiString myType; |
78 | Handle(StdObjMgt_Persistent) myObject; |
79 | Standard_Integer myRef; |
80 | |
81 | }; |
82 | |
83 | #endif // _StdStorage_Root_HeaderFile |