Audacity 3.2.0
|
RAII for a database transaction, possibly nested. More...
#include <TransactionScope.h>
Classes | |
struct | Factory |
Type of function supplying implementation of steps. More... | |
Public Member Functions | |
TransactionScope (AudacityProject &project, const char *name) | |
Construct from a project. More... | |
~TransactionScope () | |
Rollback transaction if it was not yet committed. More... | |
bool | Commit () |
Commit the transaction. More... | |
Private Attributes | |
std::unique_ptr< TransactionScopeImpl > | mpImpl |
bool | mInTrans |
wxString | mName |
RAII for a database transaction, possibly nested.
Make a savepoint (a transaction, possibly nested) with the given name; roll it back at destruction time, unless an explicit Commit() happened first. Commit() must not be called again after one successful call. An exception is thrown from the constructor if the transaction cannot open.
Definition at line 27 of file TransactionScope.h.
TransactionScope::TransactionScope | ( | AudacityProject & | project, |
const char * | name | ||
) |
Construct from a project.
If no implementation factory is installed, or the factory returns null, then this object does nothing
Definition at line 17 of file TransactionScope.cpp.
References GlobalHook< Factory, std::unique_ptr< TransactionScopeImpl >(AudacityProject &) >::Call(), Internal, mInTrans, mName, mpImpl, project, and XO().
TransactionScope::~TransactionScope | ( | ) |
Rollback transaction if it was not yet committed.
Definition at line 35 of file TransactionScope.cpp.
bool TransactionScope::Commit | ( | ) |
Commit the transaction.
Definition at line 48 of file TransactionScope.cpp.
References mInTrans, mName, mpImpl, and THROW_INCONSISTENCY_EXCEPTION.
Referenced by EffectBase::DoEffect(), and ProjectFileIO::WriteDoc().
|
private |
Definition at line 49 of file TransactionScope.h.
Referenced by Commit(), TransactionScope(), and ~TransactionScope().
|
private |
Definition at line 50 of file TransactionScope.h.
Referenced by Commit(), TransactionScope(), and ~TransactionScope().
|
private |
Definition at line 48 of file TransactionScope.h.
Referenced by Commit(), TransactionScope(), and ~TransactionScope().