From 39db797186a0db5fe3f9b548297fe87d995301b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Rombauts?= Date: Mon, 2 Apr 2012 06:35:13 +0200 Subject: [PATCH] Database and Statement objects must not be copied --- src/SQLiteC++/Database.h | 8 +++++++- src/SQLiteC++/Statement.h | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/SQLiteC++/Database.h b/src/SQLiteC++/Database.h index 3b95c38..a1a106f 100644 --- a/src/SQLiteC++/Database.h +++ b/src/SQLiteC++/Database.h @@ -72,7 +72,13 @@ public: { return mFilename; } - + +private: + // Database must be non copyable + Database(void); + Database(const Database&); + Database& operator=(const Database&); + private: sqlite3* mpSQLite; //!< Pointer to SQLite Database Connection Handle std::string mFilename; //!< UTF-8 filename used to open the database diff --git a/src/SQLiteC++/Statement.h b/src/SQLiteC++/Statement.h index 51beae3..b7bb3e6 100644 --- a/src/SQLiteC++/Statement.h +++ b/src/SQLiteC++/Statement.h @@ -137,6 +137,11 @@ public: } private: + // Database must be non copyable + Statement(void); + Statement(const Statement&); + Statement& operator=(const Statement&); + /** * @brief Check if aRet equal SQLITE_OK, else throw a SQLite::Exception with the SQLite error message */