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

  • Committer: edam
  • Date: 2010-01-28 12:21:03 UTC
  • Revision ID: edam@waxworlds.org-20100128122103-v3gs6hro5h7ffnhb
- further initial development
- basic support for: queries, rows (query results)
- filename, comment header and project name consistency

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
 
27
27
#include <sqlite3cc/basic_statement.h>
 
28
#include <boost/thread/recursive_mutex.hpp>
28
29
 
29
30
 
30
31
namespace sqlite
39
40
 */
40
41
class command
41
42
        :
42
 
        public detail::basic_statement
 
43
        public basic_statement
43
44
{
44
45
//______________________________________________________________________________
45
46
//                                                                 instantiation
46
47
public:
47
48
 
48
49
        /**
49
 
         * Constructor that provides a connection upon which to act and the SQL
 
50
         * Constructor that provides a database upon which to act and the SQL
50
51
         * command to execute.
51
 
         * @param connection a reference to a connection
 
52
         * @param database a reference to a database
52
53
         * @param sql an SQL statement in UTF-8
53
54
         */
54
55
        explicit command(
55
 
                connection &connection,
 
56
                database &database,
56
57
                const std::string &sql );
57
58
 
58
59
        /**
59
 
         * Constructor that provides a connection upon which to act.
60
 
         * @param connection a reference to a connection
 
60
         * Constructor that provides a database upon which to act.
 
61
         * @param database a reference to a database
61
62
         */
62
63
        explicit command(
63
 
                connection &connection );
 
64
                database &database );
64
65
 
65
66
//______________________________________________________________________________
66
67
//                                                              public interface
82
83
         * @return an sqlite error code
83
84
         * @see sqlite3_step()
84
85
         */
85
 
        int step();
 
86
        virtual int step();
86
87
 
87
88
        /**
88
89
         * Execute the command. This is the same as doing a step().
139
140
        /** the rowid of the last successful insert command */
140
141
        long long _last_insert_rowid;
141
142
 
 
143
        /** exclusive use during command mutex */
 
144
        static boost::recursive_mutex _command_mutex;
 
145
 
142
146
};
143
147
 
144
148
 
145
 
namespace detail
146
 
{
147
 
 
148
 
 
149
 
// template specialisations for detail::basic_statement::operator <<()
150
 
template< >
151
 
basic_statement &basic_statement::operator << < detail::exec_t >(
152
 
        const detail::exec_t & );
153
 
 
154
 
 
155
 
} // namespace detail
156
 
 
157
 
 
158
149
} // namespace sqlite
159
150
 
160
151