1 // Created by: DAUTRY Philippe
2 // Copyright (c) 1997-1999 Matra Datavision
3 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef _DDF_Transaction_HeaderFile
17 #define _DDF_Transaction_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_Type.hxx>
22 #include <TDF_Transaction.hxx>
23 #include <MMgt_TShared.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Standard_Boolean.hxx>
26 class Standard_DomainError;
27 class Standard_NullObject;
32 class DDF_Transaction;
33 DEFINE_STANDARD_HANDLE(DDF_Transaction, MMgt_TShared)
35 //! This class encapsulates TDF_Transaction.
36 class DDF_Transaction : public MMgt_TShared
42 //! Creates an empty transaction context, unable to be
44 Standard_EXPORT DDF_Transaction();
46 //! Creates a transaction context on <aDF>, ready to
48 Standard_EXPORT DDF_Transaction(const Handle(TDF_Data)& aDF);
50 //! If not yet done, opens a new transaction on
51 //! <myDF>. Returns the index of the just opened
54 //! It raises DomainError if the transaction is
55 //! already open, and NullObject if there is no
56 //! current Data framework.
57 Standard_EXPORT Standard_Integer Open();
59 //! Commits the transactions until AND including the
60 //! current opened one.
61 Standard_EXPORT Handle(TDF_Delta) Commit (const Standard_Boolean withDelta = Standard_False);
63 //! Aborts the transactions until AND including the
64 //! current opened one.
65 Standard_EXPORT void Abort();
71 //! Returns the Data from TDF.
72 Standard_EXPORT Handle(TDF_Data) Data() const;
74 //! Returns the number of the transaction opened by <me>.
75 Standard_EXPORT Standard_Integer Transaction() const;
77 //! Returns true if the transaction is open.
78 Standard_EXPORT Standard_Boolean IsOpen() const;
82 DEFINE_STANDARD_RTTI(DDF_Transaction,MMgt_TShared)
92 TDF_Transaction myTransaction;
103 #endif // _DDF_Transaction_HeaderFile