0026229: Add the possibility in OCAF to open/save a document from/to a stream object
[occt.git] / src / DDF / DDF_Transaction.cxx
CommitLineData
b311480e 1// Created by: DAUTRY Philippe
2// Copyright (c) 1997-1999 Matra Datavision
973c2be1 3// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 4//
973c2be1 5// This file is part of Open CASCADE Technology software library.
b311480e 6//
d5f74e42 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
973c2be1 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.
b311480e 12//
973c2be1 13// Alternatively, this file may be used under the terms of Open CASCADE
14// commercial license or contractual agreement.
b311480e 15
7fd59977 16// -------------------
7fd59977 17// Version: 0.0
b311480e 18//Version Date Purpose
7fd59977 19// 0.0 Nov 4 1997 Creation
20
42cf5bc1 21#include <DDF_Transaction.hxx>
22#include <Standard_DomainError.hxx>
23#include <Standard_NullObject.hxx>
24#include <Standard_Type.hxx>
25#include <TDF_Data.hxx>
26#include <TDF_Delta.hxx>
7fd59977 27
92efcf78 28IMPLEMENT_STANDARD_RTTIEXT(DDF_Transaction,MMgt_TShared)
29
7fd59977 30//=======================================================================
31//function : DDF_Transaction
32//purpose :
33//=======================================================================
7fd59977 34DDF_Transaction::DDF_Transaction()
35: myTransaction( TCollection_AsciiString() )
36{}
37
38
39//=======================================================================
40//function : DDF_Transaction
41//purpose :
42//=======================================================================
43
44DDF_Transaction::DDF_Transaction(const Handle(TDF_Data)& aDF)
45: myTransaction( TCollection_AsciiString() )
46{ myTransaction.Initialize(aDF); }
47
48
49//=======================================================================
50//function : Open
51//purpose :
52//=======================================================================
53
54Standard_Integer DDF_Transaction::Open()
55{ return myTransaction.Open(); }
56
57
58//=======================================================================
59//function : Commit
60//purpose :
61//=======================================================================
62
63Handle(TDF_Delta) DDF_Transaction::Commit(const Standard_Boolean withDelta)
64{ return myTransaction.Commit(withDelta); }
65
66
67//=======================================================================
68//function : Abort
69//purpose : alias ~
70//=======================================================================
71
72void DDF_Transaction::Abort()
73{ myTransaction.Abort(); }
74
75
76//=======================================================================
77//function : Data
78//purpose :
79//=======================================================================
80
81Handle(TDF_Data) DDF_Transaction::Data() const
82{ return myTransaction.Data(); }
83
84
85//=======================================================================
86//function : Transaction
87//purpose :
88//=======================================================================
89
90Standard_Integer DDF_Transaction::Transaction() const
91{ return myTransaction.Transaction(); }
92
93
94//=======================================================================
95//function : IsOpen
96//purpose :
97//=======================================================================
98
99Standard_Boolean DDF_Transaction::IsOpen() const
100{ return myTransaction.IsOpen(); }
101