/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:46:42 UTC
  • Revision ID: edam@waxworlds.org-20100727154642-1uxrjkpxhp7xl6hq
- moved null_t, exec_t and set_index_t to detail namespace so only their extern instantiations are in the main namespace
- added immediate transation

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
 */
38
41
class basic_transaction
39
42
        :
40
43
        private boost::noncopyable
82
85
////////////////////////////////////////////////////////////////////////////////
83
86
 
84
87
 
 
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
 */
85
124
class exclusive_transaction
86
125
        :
87
126
        public basic_transaction
112
151
////////////////////////////////////////////////////////////////////////////////
113
152
 
114
153
 
 
154
/**
 
155
 * A recursive transaction, allowing transactions to be nested.
 
156
 */
115
157
class recursive_transaction
116
158
        :
117
159
        public basic_transaction
159
201
////////////////////////////////////////////////////////////////////////////////
160
202
 
161
203
 
 
204
/**
 
205
 * A scope guard, or sentinel for use with one of the transaction classes.
 
206
 */
162
207
template< class T = basic_transaction >
163
208
class transaction_guard
164
209
        :