Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-04 08:42:51

0001 // Created on: 1997-10-22
0002 // Created by: Jean-Louis Frenkel
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 _CDM_Application_HeaderFile
0018 #define _CDM_Application_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Standard_Transient.hxx>
0023 #include <Standard_Integer.hxx>
0024 #include <CDM_MetaDataLookUpTable.hxx>
0025 #include <Message_ProgressRange.hxx>
0026 
0027 class CDM_MetaData;
0028 class CDM_Document;
0029 class Resource_Manager;
0030 class Message_Messenger;
0031 class PCDM_ReaderFilter;
0032 
0033 class CDM_Application;
0034 DEFINE_STANDARD_HANDLE(CDM_Application, Standard_Transient)
0035 
0036 class CDM_Application : public Standard_Transient
0037 {
0038 
0039 public:
0040   //! The manager returned by  this virtual  method will be
0041   //! used to search for Format.Retrieval  resource items.
0042   Standard_EXPORT virtual Handle(Resource_Manager) Resources() = 0;
0043 
0044   //! Returns default messenger;
0045   Standard_EXPORT virtual Handle(Message_Messenger) MessageDriver();
0046 
0047   //! this method is called before the update of a document.
0048   //! By default, writes in MessageDriver().
0049   Standard_EXPORT virtual void BeginOfUpdate(const Handle(CDM_Document)& aDocument);
0050 
0051   //! this method is called after the update of a document.
0052   //! By default, writes in MessageDriver().
0053   Standard_EXPORT virtual void EndOfUpdate(const Handle(CDM_Document)&       aDocument,
0054                                            const Standard_Boolean            theStatus,
0055                                            const TCollection_ExtendedString& ErrorString);
0056 
0057   //! writes the string in the application MessagerDriver.
0058   Standard_EXPORT void Write(const Standard_ExtString aString);
0059 
0060   //! Returns the application name.
0061   Standard_EXPORT virtual TCollection_ExtendedString Name() const;
0062 
0063   //! Returns the application version.
0064   Standard_EXPORT virtual TCollection_AsciiString Version() const;
0065 
0066   //! Returns MetaData LookUpTable
0067   Standard_EXPORT virtual CDM_MetaDataLookUpTable& MetaDataLookUpTable();
0068 
0069   //! Dumps the content of me into the stream
0070   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0071 
0072   friend class CDM_Reference;
0073   friend class CDM_MetaData;
0074 
0075   DEFINE_STANDARD_RTTIEXT(CDM_Application, Standard_Transient)
0076 
0077 protected:
0078   Standard_EXPORT CDM_Application();
0079 
0080   Standard_EXPORT void SetDocumentVersion(const Handle(CDM_Document)& aDocument,
0081                                           const Handle(CDM_MetaData)& aMetaData) const;
0082 
0083   Standard_EXPORT void SetReferenceCounter(const Handle(CDM_Document)& aDocument,
0084                                            const Standard_Integer      aReferenceCounter);
0085 
0086 private:
0087   Standard_EXPORT virtual Handle(CDM_Document) Retrieve(
0088     const Handle(CDM_MetaData)&      aMetaData,
0089     const Standard_Boolean           UseStorageConfiguration,
0090     const Handle(PCDM_ReaderFilter)& theFilter = Handle(PCDM_ReaderFilter)(),
0091     const Message_ProgressRange&     theRange  = Message_ProgressRange()) = 0;
0092 
0093   //! returns -1 if the metadata has no modification counter.
0094   Standard_EXPORT virtual Standard_Integer DocumentVersion(
0095     const Handle(CDM_MetaData)& aMetaData) = 0;
0096 
0097   Handle(Message_Messenger) myMessenger;
0098   CDM_MetaDataLookUpTable   myMetaDataLookUpTable;
0099 };
0100 
0101 #endif // _CDM_Application_HeaderFile