Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-10-04 09:14:03

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_Reference_HeaderFile
0018 #define _CDM_Reference_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <CDM_DocumentPointer.hxx>
0024 #include <Standard_Integer.hxx>
0025 #include <Standard_Transient.hxx>
0026 class CDM_Document;
0027 class CDM_Application;
0028 class CDM_MetaData;
0029 
0030 class CDM_Reference : public Standard_Transient
0031 {
0032 
0033 public:
0034   Standard_EXPORT occ::handle<CDM_Document> FromDocument();
0035 
0036   Standard_EXPORT occ::handle<CDM_Document> ToDocument();
0037 
0038   Standard_EXPORT int ReferenceIdentifier();
0039 
0040   Standard_EXPORT int DocumentVersion() const;
0041 
0042   Standard_EXPORT bool IsReadOnly() const;
0043 
0044   //! Dumps the content of me into the stream
0045   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, int theDepth = -1) const;
0046 
0047   friend class CDM_Document;
0048 
0049   DEFINE_STANDARD_RTTIEXT(CDM_Reference, Standard_Transient)
0050 
0051 private:
0052   Standard_EXPORT CDM_Reference(const occ::handle<CDM_Document>& aFromDocument,
0053                                 const occ::handle<CDM_Document>& aToDocument,
0054                                 const int                        aReferenceIdentifier,
0055                                 const int                        aToDocumentVersion);
0056 
0057   Standard_EXPORT CDM_Reference(const occ::handle<CDM_Document>&    aFromDocument,
0058                                 const occ::handle<CDM_MetaData>&    aMetaData,
0059                                 const int                           aReferenceIdentifier,
0060                                 const occ::handle<CDM_Application>& anApplication,
0061                                 const int                           aToDocumentVersion,
0062                                 const bool                          UseStorageConfiguration);
0063 
0064   Standard_EXPORT void Update(const occ::handle<CDM_MetaData>& aMetaData);
0065 
0066   //! compares the actual document version with the
0067   //! document version at the creation of the reference
0068   Standard_EXPORT bool IsUpToDate() const;
0069 
0070   Standard_EXPORT void SetIsUpToDate();
0071 
0072   Standard_EXPORT void UnsetToDocument(const occ::handle<CDM_MetaData>&    aMetaData,
0073                                        const occ::handle<CDM_Application>& anApplication);
0074 
0075   //! returns true if the ToDocument has been retrieved
0076   //! and opened.
0077   Standard_EXPORT bool IsOpened() const;
0078 
0079   Standard_EXPORT occ::handle<CDM_Document> Document() const;
0080 
0081   Standard_EXPORT occ::handle<CDM_MetaData> MetaData() const;
0082 
0083   Standard_EXPORT occ::handle<CDM_Application> Application() const;
0084 
0085   Standard_EXPORT bool UseStorageConfiguration() const;
0086 
0087   Standard_EXPORT bool IsInSession() const;
0088 
0089   Standard_EXPORT bool IsStored() const;
0090 
0091   occ::handle<CDM_Document>    myToDocument;
0092   CDM_DocumentPointer          myFromDocument;
0093   int                          myReferenceIdentifier;
0094   occ::handle<CDM_Application> myApplication;
0095   occ::handle<CDM_MetaData>    myMetaData;
0096   int                          myDocumentVersion;
0097   bool                         myUseStorageConfiguration;
0098 };
0099 
0100 #endif // _CDM_Reference_HeaderFile