// Copyright (c) 2015 OPEN CASCADE SAS // // This file is part of Open CASCADE Technology software library. // // This library is free software; you can redistribute it and/or modify it under // the terms of the GNU Lesser General Public License version 2.1 as published // by the Free Software Foundation, with special exception defined in the file // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT // distribution for complete text of the license and disclaimer of any warranty. // // Alternatively, this file may be used under the terms of Open CASCADE // commercial license or contractual agreement. #ifndef _StdObjMgt_Persistent_HeaderFile #define _StdObjMgt_Persistent_HeaderFile #include #include #include #include class StdObjMgt_ReadData; class TDocStd_Document; class TDF_Attribute; class TDF_Data; class TCollection_HAsciiString; class TCollection_HExtendedString; //! Root class for a temporary persistent object that reads data from a file //! and then creates transient object using the data. class StdObjMgt_Persistent : public Standard_Transient { public: //! Derived class instance create function. typedef Handle(StdObjMgt_Persistent) (*Instantiator)(); //! Create a derived class instance. template static Handle(StdObjMgt_Persistent) Instantiate() { return new Persistent; } //! Read persistent data from a file. Standard_EXPORT virtual void Read (StdObjMgt_ReadData& theReadData) = 0; //! Import transient document from the persistent data //! (to be overriden by document class; //! does nothing by default for other classes). Standard_EXPORT virtual void ImportDocument (const Handle(TDocStd_Document)& theDocument) const; //! Create an empty transient attribuite //! (to be overriden by attribute classes; //! does nothing and returns a null handle by default for other classes). Standard_EXPORT virtual Handle(TDF_Attribute) CreateAttribute(); //! Get transient attribuite for the persistent data //! (to be overriden by attribute classes; //! returns a null handle by default for non-attribute classes). Standard_EXPORT virtual Handle(TDF_Attribute) GetAttribute() const; //! Import transient attribuite from the persistent data //! (to be overriden by attribute classes; //! does nothing by default for non-attribute classes). Standard_EXPORT virtual void ImportAttribute(); //! Get referenced ASCII string //! (to be overriden by ASCII string class; //! returns a null handle by default for other classes). Standard_EXPORT virtual Handle(TCollection_HAsciiString) AsciiString() const; //! Get referenced extended string //! (to be overriden by extended string class; //! returns a null handle by default for other classes). Standard_EXPORT virtual Handle(TCollection_HExtendedString) ExtString() const; //! Get a label expressed by referenced extended string //! (to be overriden by extended string class; //! returns a null label by default for other classes). Standard_EXPORT virtual TDF_Label Label (const Handle(TDF_Data)& theDF) const; }; #endif // _StdObjMgt_Persistent_HeaderFile