0031918: Application Framework - New binary format for fast reading part of OCAF...
[occt.git] / src / CDM / CDM_Application.hxx
CommitLineData
42cf5bc1 1// Created on: 1997-10-22
2// Created by: Jean-Louis Frenkel
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 _CDM_Application_HeaderFile
18#define _CDM_Application_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <Standard_Transient.hxx>
24#include <Standard_Boolean.hxx>
25#include <Standard_Integer.hxx>
26#include <Standard_ExtString.hxx>
fe21f796
BB
27#include <TCollection_AsciiString.hxx>
28#include <TCollection_ExtendedString.hxx>
d9d03f10 29#include <CDM_MetaDataLookUpTable.hxx>
7e785937 30#include <Message_ProgressRange.hxx>
fe21f796 31
42cf5bc1 32class CDM_Reference;
33class CDM_MetaData;
34class CDM_Document;
35class Resource_Manager;
83ae3591 36class Message_Messenger;
d5c71e20 37class PCDM_ReaderFilter;
42cf5bc1 38
39class CDM_Application;
40DEFINE_STANDARD_HANDLE(CDM_Application, Standard_Transient)
41
42
43class CDM_Application : public Standard_Transient
44{
45
46public:
47
48
6fe96f84 49 //! The manager returned by this virtual method will be
50 //! used to search for Format.Retrieval resource items.
42cf5bc1 51 Standard_EXPORT virtual Handle(Resource_Manager) Resources() = 0;
52
83ae3591 53 //! Returns default messenger;
54 Standard_EXPORT virtual Handle(Message_Messenger) MessageDriver();
42cf5bc1 55
56 //! this method is called before the update of a document.
57 //! By default, writes in MessageDriver().
58 Standard_EXPORT virtual void BeginOfUpdate (const Handle(CDM_Document)& aDocument);
59
60 //! this method is called affter the update of a document.
61 //! By default, writes in MessageDriver().
9fd2d2c3 62 Standard_EXPORT virtual void EndOfUpdate (const Handle(CDM_Document)& aDocument, const Standard_Boolean theStatus, const TCollection_ExtendedString& ErrorString);
42cf5bc1 63
64 //! writes the string in the application MessagerDriver.
65 Standard_EXPORT void Write (const Standard_ExtString aString);
66
fe21f796
BB
67 //! Returns the application name.
68 Standard_EXPORT virtual TCollection_ExtendedString Name() const;
69
70 //! Returns the application version.
71 Standard_EXPORT virtual TCollection_AsciiString Version() const;
bc73b006 72
d9d03f10 73 //! Returns MetaData LookUpTable
8a39adb7 74 Standard_EXPORT virtual CDM_MetaDataLookUpTable& MetaDataLookUpTable();
d9d03f10 75
bc73b006 76 //! Dumps the content of me into the stream
77 Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
42cf5bc1 78
79friend class CDM_Reference;
80friend class CDM_MetaData;
81
82
92efcf78 83 DEFINE_STANDARD_RTTIEXT(CDM_Application,Standard_Transient)
42cf5bc1 84
85protected:
86
d9d03f10 87 Standard_EXPORT CDM_Application();
88
42cf5bc1 89 Standard_EXPORT void SetDocumentVersion (const Handle(CDM_Document)& aDocument, const Handle(CDM_MetaData)& aMetaData) const;
90
91 Standard_EXPORT void SetReferenceCounter (const Handle(CDM_Document)& aDocument, const Standard_Integer aReferenceCounter);
92
42cf5bc1 93private:
94
95
6d8f9f4a 96 Standard_EXPORT virtual Handle(CDM_Document) Retrieve
97 (const Handle(CDM_MetaData)& aMetaData,
98 const Standard_Boolean UseStorageConfiguration,
d5c71e20 99 const Handle(PCDM_ReaderFilter)& theFilter = Handle(PCDM_ReaderFilter)(),
7e785937 100 const Message_ProgressRange& theRange = Message_ProgressRange()) = 0;
42cf5bc1 101
102 //! returns -1 if the metadata has no modification counter.
103 Standard_EXPORT virtual Standard_Integer DocumentVersion (const Handle(CDM_MetaData)& aMetaData) = 0;
104
d9d03f10 105 Handle(Message_Messenger) myMessenger;
106 CDM_MetaDataLookUpTable myMetaDataLookUpTable;
42cf5bc1 107
108};
109
110
111
112
113
114
115
116#endif // _CDM_Application_HeaderFile