diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-15 18:43:03 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-15 18:43:03 +0200 |
commit | 0f9cfacd6cc45f78f1453a8eeb7ffa542dc5dc48 (patch) | |
tree | 76b5baf158e35988d7b14d437f1a03774e0e0742 /odb/sqlite/connection.hxx | |
parent | 27a578709046a81bb0efc0027bfc74318615447e (diff) |
Implement SQLite incremental BLOB/TEXT I/O
Diffstat (limited to 'odb/sqlite/connection.hxx')
-rw-r--r-- | odb/sqlite/connection.hxx | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/odb/sqlite/connection.hxx b/odb/sqlite/connection.hxx index 8e54388..f8378fb 100644 --- a/odb/sqlite/connection.hxx +++ b/odb/sqlite/connection.hxx @@ -34,6 +34,39 @@ namespace odb class connection; typedef details::shared_ptr<connection> connection_ptr; + // SQLite "active object", i.e., an object that needs to be + // "cleared" before the transaction can be committed and the + // connection release. These form a doubly-linked list. + // + class active_object + { + public: + // This function should remove the object from the list, since + // it shall no longer be "active". + // + virtual void + clear () = 0; + + protected: + active_object (connection& c): prev_ (0), next_ (this), conn_ (c) {} + + void + list_add (); + + void + list_remove (); + + protected: + // prev_ == 0 means we are the first element. + // next_ == 0 means we are the last element. + // next_ == this means we are not on the list (prev_ should be 0). + // + active_object* prev_; + active_object* next_; + + connection& conn_; + }; + class LIBODB_SQLITE_EXPORT connection: public odb::connection { public: @@ -165,12 +198,12 @@ namespace odb private: friend class transaction_impl; // invalidate_results() - // Linked list of active statements currently associated + // Linked list of active objects currently associated // with this connection. // private: - friend class statement; - statement* statements_; + friend class active_object; + active_object* active_objects_; }; } } |