SQLite::Transaction Class Reference

Wrapper class for actual transactions. More...

#include <SQLiteDB.h>

Collaboration diagram for SQLite::Transaction:
Collaboration graph
[legend]

List of all members.

Public Types

enum  TransactionType
 

Definition of types of transactions supported.


Public Member Functions

 Transaction (const Transaction &other)
 Copy constructor.
virtual ~Transaction ()
 Destructor.
bool Close ()
 End the transaction (commiting it).
bool Commit ()
 Commit the transaction.
bool Rollback ()
 Rollback the transaction.
bool Execute (LPCTSTR pSQL)
 Execute an SQL command as a part of the transaction.
bool Execute (const std::string &sSQL)
 Execute an SQL command as a part of the transaction.
bool Execute (Statement &state)
 Execute a statement as a part of the transaction.
Recordset Query (LPCTSTR pSQL)
 Run query as a part of the transaction.
Recordset Query (const std::string &sSQL)
 Run query as a part of the transaction.
Recordset Query (Statement &state)
 Run a SELECT statement as a part of the transaction.
const std::tstring & GetLastError ()
 Retrieves the description of the last error found while performing the transaction.
virtual const Transactionoperator= (const Transaction &other)
 Assignment operator.

Protected Member Functions

 Transaction (RealTransaction *pReal)
 Constructor from an actual transaction object.
void AddRef () const
 Adds a reference to the actual transaction object.
void DecRef () const
 Deletes a reference to the actual transaction object (can delete the object).

Protected Attributes

RealTransactionm_pReal
 Pointer to the actual transaction object wrapped.

Detailed Description

Wrapper class for actual transactions.

Definition at line 369 of file SQLiteDB.h.


Constructor & Destructor Documentation

SQLite::Transaction::Transaction ( const Transaction other  )  [inline]

Copy constructor.

Parameters:
other The transaction wrapper object to copy from

Definition at line 377 of file SQLiteDB.h.

References AddRef().

SQLite::Transaction::Transaction ( RealTransaction pReal  )  [inline, protected]

Constructor from an actual transaction object.

Parameters:
pReal Pointer to the actual transaction object to wrap

Definition at line 387 of file SQLiteDB.h.

References AddRef().


Member Function Documentation

bool SQLite::Transaction::Close (  ) 

End the transaction (commiting it).

Returns:
true if the transaction was successfuly closed, false otherwise

Definition at line 1112 of file SQLiteDB.cpp.

References SQLite::RealTransaction::Close(), and m_pReal.

bool SQLite::Transaction::Commit (  ) 

Commit the transaction.

Returns:
true if the transaction was commited successfully, false otherwise

Definition at line 1120 of file SQLiteDB.cpp.

References SQLite::RealTransaction::Commit(), and m_pReal.

bool SQLite::Transaction::Execute ( Statement statment  ) 

Execute a statement as a part of the transaction.

Parameters:
statment SQL statement wrapper object to perform
Returns:
true if the statement was performed successfully, false if failed

Definition at line 1146 of file SQLiteDB.cpp.

References SQLite::RealTransaction::Execute(), and m_pReal.

bool SQLite::Transaction::Execute ( const std::string &  sSQL  )  [inline]

Execute an SQL command as a part of the transaction.

Parameters:
sSQL The statement to execute
Returns:
true if executed successfully, false if failed

Definition at line 415 of file SQLiteDB.h.

References Execute().

Referenced by Execute().

bool SQLite::Transaction::Execute ( LPCTSTR  pSQL  ) 

Execute an SQL command as a part of the transaction.

Parameters:
pSQL SQL statement to perform
Returns:
true if the statement was performed successfully, false if failed

Definition at line 1137 of file SQLiteDB.cpp.

References SQLite::RealTransaction::Execute(), and m_pReal.

const std::tstring & SQLite::Transaction::GetLastError (  ) 

Retrieves the description of the last error found while performing the transaction.

Returns:
The description of the last error that occured while performing the transaction

Definition at line 1188 of file SQLiteDB.cpp.

References SQLite::RealTransaction::GetLastError(), and m_pReal.

virtual const Transaction& SQLite::Transaction::operator= ( const Transaction other  )  [inline, virtual]

Assignment operator.

Parameters:
other The transaction wrapper object to copy
Returns:
A reference to this object

Definition at line 439 of file SQLiteDB.h.

References AddRef(), DecRef(), and m_pReal.

Recordset SQLite::Transaction::Query ( Statement statement  ) 

Run a SELECT statement as a part of the transaction.

Parameters:
statement SQL query statement to perform
Returns:
A query result set wrapper objectc

Definition at line 1164 of file SQLiteDB.cpp.

References m_pReal, and SQLite::RealTransaction::Query().

Recordset SQLite::Transaction::Query ( const std::string &  sSQL  )  [inline]

Run query as a part of the transaction.

Parameters:
sSQL The SQL query to perform
Returns:
The results of the query

Definition at line 425 of file SQLiteDB.h.

References Query().

Referenced by Query().

Recordset SQLite::Transaction::Query ( LPCTSTR  pSQL  ) 

Run query as a part of the transaction.

Parameters:
pSQL SQL query to perform
Returns:
A query result set wrapper objectc

Definition at line 1155 of file SQLiteDB.cpp.

References m_pReal, and SQLite::RealTransaction::Query().

bool SQLite::Transaction::Rollback (  ) 

Rollback the transaction.

Returns:
true if the transaction was rolled back successfully, false otherwise

Definition at line 1128 of file SQLiteDB.cpp.

References m_pReal, and SQLite::RealTransaction::Rollback().


The documentation for this class was generated from the following files:

Generated on Mon Jun 18 12:40:51 2012 for CC PDF Converter by doxygen 1.6.1