Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-26 09:04:59

0001 // Created on: 1997-02-06
0002 // Created by: Kernel
0003 // Copyright (c) 1997-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Storage_RootData_HeaderFile
0018 #define _Storage_RootData_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <Storage_Root.hxx>
0024 #include <TCollection_AsciiString.hxx>
0025 #include <NCollection_DataMap.hxx>
0026 #include <Storage_Error.hxx>
0027 #include <Standard_Transient.hxx>
0028 #include <Standard_Integer.hxx>
0029 #include <NCollection_Sequence.hxx>
0030 #include <NCollection_HSequence.hxx>
0031 class Storage_BaseDriver;
0032 class Storage_Root;
0033 class Standard_Persistent;
0034 
0035 class Storage_RootData : public Standard_Transient
0036 {
0037 
0038 public:
0039   Standard_EXPORT Storage_RootData();
0040 
0041   Standard_EXPORT bool Read(const occ::handle<Storage_BaseDriver>& theDriver);
0042 
0043   //! returns the number of roots.
0044   Standard_EXPORT int NumberOfRoots() const;
0045 
0046   //! add a root to <me>. If a root with same name is present, it
0047   //! will be replaced by <aRoot>.
0048   Standard_EXPORT void AddRoot(const occ::handle<Storage_Root>& aRoot);
0049 
0050   Standard_EXPORT occ::handle<NCollection_HSequence<occ::handle<Storage_Root>>> Roots() const;
0051 
0052   //! find a root with name <aName>.
0053   Standard_EXPORT occ::handle<Storage_Root> Find(const TCollection_AsciiString& aName) const;
0054 
0055   //! returns true if <me> contains a root named <aName>
0056   Standard_EXPORT bool IsRoot(const TCollection_AsciiString& aName) const;
0057 
0058   //! remove the root named <aName>.
0059   Standard_EXPORT void RemoveRoot(const TCollection_AsciiString& aName);
0060 
0061   Standard_EXPORT Storage_Error ErrorStatus() const;
0062 
0063   Standard_EXPORT TCollection_AsciiString ErrorStatusExtension() const;
0064 
0065   Standard_EXPORT void ClearErrorStatus();
0066 
0067   Standard_EXPORT void UpdateRoot(const TCollection_AsciiString&          aName,
0068                                   const occ::handle<Standard_Persistent>& aPers);
0069 
0070   friend class Storage_Schema;
0071 
0072   DEFINE_STANDARD_RTTIEXT(Storage_RootData, Standard_Transient)
0073 
0074 private:
0075   Standard_EXPORT void SetErrorStatus(const Storage_Error anError);
0076 
0077   Standard_EXPORT void SetErrorStatusExtension(const TCollection_AsciiString& anErrorExt);
0078 
0079   NCollection_DataMap<TCollection_AsciiString, occ::handle<Storage_Root>> myObjects;
0080   Storage_Error                                                           myErrorStatus;
0081   TCollection_AsciiString                                                 myErrorStatusExt;
0082 };
0083 
0084 #endif // _Storage_RootData_HeaderFile