/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/database.h

  • Committer: edam
  • Date: 2010-07-29 09:16:26 UTC
  • Revision ID: edam@waxworlds.org-20100729091626-h8fmg0r74eyfo5ae
- fixed error caused by finialising in-progress queries during rollback that were later finaliased by RAII.

Show diffs side-by-side

added added

removed removed

26
26
 
27
27
#include <sqlite3.h>
28
28
#include <boost/utility.hpp>
 
29
#include <string>
29
30
 
30
31
 
31
32
namespace sqlite
33
34
 
34
35
 
35
36
class basic_statement;
36
 
class transaction;
 
37
class basic_transaction;
37
38
 
38
39
 
39
40
class database
97
98
 
98
99
//______________________________________________________________________________
99
100
//                                                                implementation
100
 
private:
 
101
protected:
101
102
 
102
103
        friend class basic_statement;
 
104
        friend class basic_transaction;
103
105
        friend class command;
 
106
        friend class query;
 
107
        friend class sqlite_error;
 
108
 
 
109
        /** class to provide a scope lock for the database mutex */
 
110
        class database_mutex_guard
 
111
        {
 
112
        public:
 
113
 
 
114
                /** constructor that provides a database */
 
115
                database_mutex_guard(
 
116
                        database &database );
 
117
 
 
118
                ~database_mutex_guard();
 
119
 
 
120
                /** release the mutex early */
 
121
                void leave();
 
122
 
 
123
        private:
 
124
                sqlite3_mutex *_mutex;
 
125
        };
 
126
 
 
127
private:
104
128
 
105
129
        /** the database handle */
106
130
        sqlite3 *_handle;