//  // //  #### # # # -= SQLiteX =-  // // # # ## ## Transaction.h  // //  ## # ###  // //  ## # ### SQL transaction  // //  # # ## ##  // // #### ##### # # R1 (C)2005 Markus Ewald -> License.txt  // //  // #ifndef SQLITEX_TRANSACTION_H #define SQLITEX_TRANSACTION_H #include "SQLiteX/SQLiteX.h" #include "SQLiteX/Query.h" #include #include #include namespace SQLiteX { class Database; //  // //  SQLiteX::Transaction  // //  // /// SQL transaction /** Groups a series of SQL instructions which are executed as a transaction on the database. This means that either the whole group succeeds or, if an error occurs, nothing will have happened at all. */ class Transaction { friend Database; public: /// Constructor SQLITEX_API explicit Transaction(const std::string &sName = std::string()); /// Destructor SQLITEX_API ~Transaction(); // // Transaction implementation // public: /// Add statements directly to the transaction SQLITEX_API void add(const std::string &sStatements); /// Add a query to the transaction SQLITEX_API void add(const Query &TheQuery); protected: /// Execute the entire transaction SQLITEX_API void execute(const SharedSQLite3 &SQLiteDB); private: /// A deque of SQL queries typedef std::deque QueryDeque; /// Name of the transaction std::string m_sName; /// Queries to be executed in the transaction QueryDeque m_Queries; }; } // namespace SQLiteX #endif // SQLITEX_TRANSACTION_H