Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-12-01 10:15:37

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 <TCollection_ExtendedString.hxx>
0025 #include <NCollection_DataMap.hxx>
0026 #include <Message_ProgressRange.hxx>
0027 
0028 class CDM_MetaData;
0029 class CDM_Document;
0030 class Resource_Manager;
0031 class Message_Messenger;
0032 class PCDM_ReaderFilter;
0033 
0034 class CDM_Application : public Standard_Transient
0035 {
0036 
0037 public:
0038   //! The manager returned by this virtual method will be
0039   //! used to search for Format.Retrieval resource items.
0040   Standard_EXPORT virtual occ::handle<Resource_Manager> Resources() = 0;
0041 
0042   //! Returns default messenger;
0043   Standard_EXPORT virtual occ::handle<Message_Messenger> MessageDriver();
0044 
0045   //! this method is called before the update of a document.
0046   //! By default, writes in MessageDriver().
0047   Standard_EXPORT virtual void BeginOfUpdate(const occ::handle<CDM_Document>& aDocument);
0048 
0049   //! this method is called after the update of a document.
0050   //! By default, writes in MessageDriver().
0051   Standard_EXPORT virtual void EndOfUpdate(const occ::handle<CDM_Document>&  aDocument,
0052                                            const bool                        theStatus,
0053                                            const TCollection_ExtendedString& ErrorString);
0054 
0055   //! writes the string in the application MessagerDriver.
0056   Standard_EXPORT void Write(const char16_t* const aString);
0057 
0058   //! Returns the application name.
0059   Standard_EXPORT virtual TCollection_ExtendedString Name() const;
0060 
0061   //! Returns the application version.
0062   Standard_EXPORT virtual TCollection_AsciiString Version() const;
0063 
0064   //! Returns MetaData LookUpTable
0065   Standard_EXPORT virtual NCollection_DataMap<TCollection_ExtendedString,
0066                                               occ::handle<CDM_MetaData>>&
0067     MetaDataLookUpTable();
0068 
0069   //! Dumps the content of me into the stream
0070   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int 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 occ::handle<CDM_Document>& aDocument,
0081                                           const occ::handle<CDM_MetaData>& aMetaData) const;
0082 
0083   Standard_EXPORT void SetReferenceCounter(const occ::handle<CDM_Document>& aDocument,
0084                                            const int                        aReferenceCounter);
0085 
0086 private:
0087   Standard_EXPORT virtual occ::handle<CDM_Document> Retrieve(
0088     const occ::handle<CDM_MetaData>&      aMetaData,
0089     const bool                            UseStorageConfiguration,
0090     const occ::handle<PCDM_ReaderFilter>& theFilter = occ::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 int DocumentVersion(const occ::handle<CDM_MetaData>& aMetaData) = 0;
0095 
0096   occ::handle<Message_Messenger>                                             myMessenger;
0097   NCollection_DataMap<TCollection_ExtendedString, occ::handle<CDM_MetaData>> myMetaDataLookUpTable;
0098 };
0099 
0100 #endif // _CDM_Application_HeaderFile