diff options
Diffstat (limited to 'storage.h')
-rw-r--r-- | storage.h | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -1,5 +1,6 @@ #pragma once +#include <memory> #include <string> #include <tuple> @@ -11,6 +12,7 @@ class Storage { public: Storage(const Config& config); + ~Storage(); uint64_t getNumberOfDocuments(); bool exists(const std::string& id); @@ -30,5 +32,20 @@ public: private: SQLite::Database m_db; uint64_t m_maxage; + + // shared_ptr to work around initialization in constructor + std::shared_ptr<SQLite::Statement> m_stmt_create; + std::shared_ptr<SQLite::Statement> m_stmt_getNumberOfDocuments; + std::shared_ptr<SQLite::Statement> m_stmt_cleanup; + std::shared_ptr<SQLite::Statement> m_stmt_exists; + std::shared_ptr<SQLite::Statement> m_stmt_getDocument; + std::shared_ptr<SQLite::Statement> m_stmt_getRevision; + std::shared_ptr<SQLite::Statement> m_stmt_getCursorPos; + std::shared_ptr<SQLite::Statement> m_stmt_getRow; + std::shared_ptr<SQLite::Statement> m_stmt_setDocument; + std::shared_ptr<SQLite::Statement> m_stmt_setDocument_new; + std::shared_ptr<SQLite::Statement> m_stmt_setRevision; + std::shared_ptr<SQLite::Statement> m_stmt_setCursorPos; + std::shared_ptr<SQLite::Statement> m_stmt_setRow; }; |