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_Reference_HeaderFile |
18 | #define _CDM_Reference_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <CDM_DocumentPointer.hxx> |
24 | #include <Standard_Integer.hxx> |
25 | #include <Standard_Boolean.hxx> |
26 | #include <Standard_Transient.hxx> |
27 | class CDM_Document; |
28 | class CDM_Application; |
29 | class CDM_MetaData; |
30 | |
31 | |
32 | class CDM_Reference; |
33 | DEFINE_STANDARD_HANDLE(CDM_Reference, Standard_Transient) |
34 | |
35 | |
36 | class CDM_Reference : public Standard_Transient |
37 | { |
38 | |
39 | public: |
40 | |
41 | |
42 | Standard_EXPORT Handle(CDM_Document) FromDocument(); |
43 | |
44 | Standard_EXPORT Handle(CDM_Document) ToDocument(); |
45 | |
46 | Standard_EXPORT Standard_Integer ReferenceIdentifier(); |
47 | |
48 | Standard_EXPORT Standard_Integer DocumentVersion() const; |
49 | |
50 | Standard_EXPORT Standard_Boolean IsReadOnly() const; |
bc73b006 |
51 | |
52 | //! Dumps the content of me into the stream |
53 | Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const; |
42cf5bc1 |
54 | |
55 | |
56 | friend class CDM_Document; |
57 | |
58 | |
92efcf78 |
59 | DEFINE_STANDARD_RTTIEXT(CDM_Reference,Standard_Transient) |
42cf5bc1 |
60 | |
61 | protected: |
62 | |
63 | |
64 | |
65 | |
66 | private: |
67 | |
68 | |
69 | Standard_EXPORT CDM_Reference(const Handle(CDM_Document)& aFromDocument, const Handle(CDM_Document)& aToDocument, const Standard_Integer aReferenceIdentifier, const Standard_Integer aToDocumentVersion); |
70 | |
71 | Standard_EXPORT CDM_Reference(const Handle(CDM_Document)& aFromDocument, const Handle(CDM_MetaData)& aMetaData, const Standard_Integer aReferenceIdentifier, const Handle(CDM_Application)& anApplication, const Standard_Integer aToDocumentVersion, const Standard_Boolean UseStorageConfiguration); |
72 | |
73 | Standard_EXPORT void Update (const Handle(CDM_MetaData)& aMetaData); |
74 | |
75 | //! compares the actual document version with the |
76 | //! document version at the creation of the reference |
77 | Standard_EXPORT Standard_Boolean IsUpToDate() const; |
78 | |
79 | Standard_EXPORT void SetIsUpToDate(); |
80 | |
81 | Standard_EXPORT void UnsetToDocument (const Handle(CDM_MetaData)& aMetaData, const Handle(CDM_Application)& anApplication); |
82 | |
83 | //! returns true if the ToDocument has been retrieved |
84 | //! and opened. |
85 | Standard_EXPORT Standard_Boolean IsOpened() const; |
86 | |
87 | Standard_EXPORT Handle(CDM_Document) Document() const; |
88 | |
89 | Standard_EXPORT Handle(CDM_MetaData) MetaData() const; |
90 | |
91 | Standard_EXPORT Handle(CDM_Application) Application() const; |
92 | |
93 | Standard_EXPORT Standard_Boolean UseStorageConfiguration() const; |
94 | |
95 | Standard_EXPORT Standard_Boolean IsInSession() const; |
96 | |
97 | Standard_EXPORT Standard_Boolean IsStored() const; |
98 | |
99 | Handle(CDM_Document) myToDocument; |
100 | CDM_DocumentPointer myFromDocument; |
101 | Standard_Integer myReferenceIdentifier; |
102 | Handle(CDM_Application) myApplication; |
103 | Handle(CDM_MetaData) myMetaData; |
104 | Standard_Integer myDocumentVersion; |
105 | Standard_Boolean myUseStorageConfiguration; |
106 | |
107 | |
108 | }; |
109 | |
110 | |
111 | |
112 | |
113 | |
114 | |
115 | |
116 | #endif // _CDM_Reference_HeaderFile |