0031668: Visualization - WebGL sample doesn't work on Emscripten 1.39
[occt.git] / src / Storage / Storage_RootData.hxx
1 // Created on: 1997-02-06
2 // Created by: Kernel
3 // Copyright (c) 1997-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Storage_RootData_HeaderFile
18 #define _Storage_RootData_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <Storage_MapOfPers.hxx>
24 #include <Storage_Error.hxx>
25 #include <TCollection_AsciiString.hxx>
26 #include <Standard_Transient.hxx>
27 #include <Standard_Integer.hxx>
28 #include <Storage_HSeqOfRoot.hxx>
29 #include <Standard_Boolean.hxx>
30 class Standard_NoSuchObject;
31 class Storage_Schema;
32 class Storage_BaseDriver;
33 class Storage_Root;
34 class TCollection_AsciiString;
35 class Standard_Persistent;
36
37
38 class Storage_RootData;
39 DEFINE_STANDARD_HANDLE(Storage_RootData, Standard_Transient)
40
41
42 class Storage_RootData : public Standard_Transient
43 {
44
45 public:
46
47   
48   Standard_EXPORT Storage_RootData();
49
50   Standard_EXPORT Standard_Boolean Read (const Handle(Storage_BaseDriver)& theDriver);
51   
52   //! returns the number of roots.
53   Standard_EXPORT Standard_Integer NumberOfRoots() const;
54   
55   //! add a root to <me>. If a root with same name is present, it
56   //! will be replaced by <aRoot>.
57   Standard_EXPORT void AddRoot (const Handle(Storage_Root)& aRoot);
58   
59   Standard_EXPORT Handle(Storage_HSeqOfRoot) Roots() const;
60   
61   //! find a root with name <aName>.
62   Standard_EXPORT Handle(Storage_Root) Find (const TCollection_AsciiString& aName) const;
63   
64   //! returns Standard_True if <me> contains a root named <aName>
65   Standard_EXPORT Standard_Boolean IsRoot (const TCollection_AsciiString& aName) const;
66   
67   //! remove the root named <aName>.
68   Standard_EXPORT void RemoveRoot (const TCollection_AsciiString& aName);
69   
70   Standard_EXPORT Storage_Error ErrorStatus() const;
71   
72   Standard_EXPORT TCollection_AsciiString ErrorStatusExtension() const;
73   
74   Standard_EXPORT void ClearErrorStatus();
75
76   Standard_EXPORT void UpdateRoot (const TCollection_AsciiString& aName, const Handle(Standard_Persistent)& aPers);
77
78 friend class Storage_Schema;
79
80
81   DEFINE_STANDARD_RTTIEXT(Storage_RootData,Standard_Transient)
82
83 protected:
84
85
86
87
88 private:
89
90   
91   
92   Standard_EXPORT void SetErrorStatus (const Storage_Error anError);
93   
94   Standard_EXPORT void SetErrorStatusExtension (const TCollection_AsciiString& anErrorExt);
95
96   Storage_MapOfPers myObjects;
97   Storage_Error myErrorStatus;
98   TCollection_AsciiString myErrorStatusExt;
99
100
101 };
102
103
104
105
106
107
108
109 #endif // _Storage_RootData_HeaderFile