Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:23

0001 // Created by: DAUTRY Philippe
0002 // Copyright (c) 1997-1999 Matra Datavision
0003 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _DDF_Transaction_HeaderFile
0017 #define _DDF_Transaction_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 
0021 #include <TDF_Transaction.hxx>
0022 #include <Standard_Transient.hxx>
0023 #include <Standard_Integer.hxx>
0024 #include <NCollection_DefineAlloc.hxx>
0025 class TDF_Data;
0026 class TDF_Delta;
0027 
0028 
0029 class DDF_Transaction;
0030 DEFINE_STANDARD_HANDLE(DDF_Transaction, Standard_Transient)
0031 
0032 //! This class encapsulates TDF_Transaction.
0033 class DDF_Transaction : public Standard_Transient
0034 {
0035 
0036 public:
0037 
0038   
0039   //! Creates an empty transaction context, unable to be
0040   //! opened.
0041   Standard_EXPORT DDF_Transaction();
0042   
0043   //! Creates a transaction context on <aDF>, ready to
0044   //! be opened.
0045   Standard_EXPORT DDF_Transaction(const Handle(TDF_Data)& aDF);
0046   
0047   //! If not yet done, opens a new transaction on
0048   //! <myDF>. Returns the index of the just opened
0049   //! transaction.
0050   //!
0051   //! It raises DomainError if the transaction is
0052   //! already open, and NullObject if there is no
0053   //! current Data framework.
0054   Standard_EXPORT Standard_Integer Open();
0055   
0056   //! Commits the transactions until AND including the
0057   //! current opened one.
0058   Standard_EXPORT Handle(TDF_Delta) Commit (const Standard_Boolean withDelta = Standard_False);
0059   
0060   //! Aborts the transactions until AND including the
0061   //! current opened one.
0062   Standard_EXPORT void Abort();
0063 ~DDF_Transaction()
0064 {
0065   Abort();
0066 }
0067   
0068   //! Returns the Data from TDF.
0069   Standard_EXPORT Handle(TDF_Data) Data() const;
0070   
0071   //! Returns the number of the transaction opened by <me>.
0072   Standard_EXPORT Standard_Integer Transaction() const;
0073   
0074   //! Returns true if the transaction is open.
0075   Standard_EXPORT Standard_Boolean IsOpen() const;
0076 
0077 
0078 
0079   DEFINE_STANDARD_RTTIEXT(DDF_Transaction,Standard_Transient)
0080 
0081 protected:
0082 
0083 
0084 
0085 
0086 private:
0087 
0088 
0089   TDF_Transaction myTransaction;
0090 
0091 
0092 };
0093 
0094 
0095 
0096 
0097 
0098 
0099 
0100 #endif // _DDF_Transaction_HeaderFile