Database and Statement objects must not be copied

This commit is contained in:
Sébastien Rombauts 2012-04-02 06:35:13 +02:00
parent 9658ee7e16
commit 39db797186
2 changed files with 12 additions and 1 deletions

View File

@ -73,6 +73,12 @@ public:
return mFilename; return mFilename;
} }
private:
// Database must be non copyable
Database(void);
Database(const Database&);
Database& operator=(const Database&);
private: private:
sqlite3* mpSQLite; //!< Pointer to SQLite Database Connection Handle sqlite3* mpSQLite; //!< Pointer to SQLite Database Connection Handle
std::string mFilename; //!< UTF-8 filename used to open the database std::string mFilename; //!< UTF-8 filename used to open the database

View File

@ -137,6 +137,11 @@ public:
} }
private: 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 * @brief Check if aRet equal SQLITE_OK, else throw a SQLite::Exception with the SQLite error message
*/ */