/sqlite3cc

To get this branch, use:
bzr branch http://bzr.ed.am/sqlite3cc

« back to all changes in this revision

Viewing changes to include/sqlite3cc/transaction.h

  • Committer: edam
  • Date: 2010-07-27 15:12:55 UTC
  • Revision ID: edam@waxworlds.org-20100727151255-goaqgdz4kj13q7gz
- update TODO
- added some missing includes for <string>
- changed usage of database::exec() to not require return code!
- prevented transaction_guard destructor from throwing an exception

Show diffs side-by-side

added added

removed removed

35
35
class database;
36
36
 
37
37
 
38
 
/**
39
 
 * A basic (default, deferred) transaction.
40
 
 */
41
38
class basic_transaction
42
39
        :
43
40
        private boost::noncopyable
85
82
////////////////////////////////////////////////////////////////////////////////
86
83
 
87
84
 
88
 
/**
89
 
 * An exclusive transaction
90
 
 */
91
 
class immediate_transaction
92
 
        :
93
 
        public basic_transaction
94
 
{
95
 
//______________________________________________________________________________
96
 
//                                                                 instantiation
97
 
public:
98
 
 
99
 
        /**
100
 
         * Constructor that provides a database upon which to act
101
 
         * @param database a database
102
 
         */
103
 
        explicit immediate_transaction(
104
 
                database &database );
105
 
 
106
 
//______________________________________________________________________________
107
 
//                                                              public interface
108
 
public:
109
 
 
110
 
        /**
111
 
         * Begin the transaction
112
 
         */
113
 
        virtual void begin();
114
 
 
115
 
};
116
 
 
117
 
 
118
 
////////////////////////////////////////////////////////////////////////////////
119
 
 
120
 
 
121
 
/**
122
 
 * An exclusive transaction
123
 
 */
124
85
class exclusive_transaction
125
86
        :
126
87
        public basic_transaction
151
112
////////////////////////////////////////////////////////////////////////////////
152
113
 
153
114
 
154
 
/**
155
 
 * A recursive transaction, allowing transactions to be nested.
156
 
 */
157
115
class recursive_transaction
158
116
        :
159
117
        public basic_transaction
201
159
////////////////////////////////////////////////////////////////////////////////
202
160
 
203
161
 
204
 
/**
205
 
 * A scope guard, or sentinel for use with one of the transaction classes.
206
 
 */
207
162
template< class T = basic_transaction >
208
163
class transaction_guard
209
164
        :