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>
21 #include <TDF_Transaction.hxx>
22 #include <Standard_Transient.hxx>
23 #include <Standard_Integer.hxx>
28 class DDF_Transaction;
29 DEFINE_STANDARD_HANDLE(DDF_Transaction, Standard_Transient)
31 //! This class encapsulates TDF_Transaction.
32 class DDF_Transaction : public Standard_Transient
38 //! Creates an empty transaction context, unable to be
40 Standard_EXPORT DDF_Transaction();
42 //! Creates a transaction context on <aDF>, ready to
44 Standard_EXPORT DDF_Transaction(const Handle(TDF_Data)& aDF);
46 //! If not yet done, opens a new transaction on
47 //! <myDF>. Returns the index of the just opened
50 //! It raises DomainError if the transaction is
51 //! already open, and NullObject if there is no
52 //! current Data framework.
53 Standard_EXPORT Standard_Integer Open();
55 //! Commits the transactions until AND including the
56 //! current opened one.
57 Standard_EXPORT Handle(TDF_Delta) Commit (const Standard_Boolean withDelta = Standard_False);
59 //! Aborts the transactions until AND including the
60 //! current opened one.
61 Standard_EXPORT void Abort();
67 //! Returns the Data from TDF.
68 Standard_EXPORT Handle(TDF_Data) Data() const;
70 //! Returns the number of the transaction opened by <me>.
71 Standard_EXPORT Standard_Integer Transaction() const;
73 //! Returns true if the transaction is open.
74 Standard_EXPORT Standard_Boolean IsOpen() const;
78 DEFINE_STANDARD_RTTIEXT(DDF_Transaction,Standard_Transient)
88 TDF_Transaction myTransaction;
99 #endif // _DDF_Transaction_HeaderFile