Leosac
0.8.0
Open Source Access Control
|
An optional transaction is an object that behave like an odb::transaction if there is no currently active transaction. More...
#include <OptionalTransaction.hpp>
Public Member Functions | |
OptionalTransaction (odb::transaction_impl *impl) | |
~OptionalTransaction () | |
void | commit () |
Commit the transaction, if there was no currently active transaction at the time of this object's creation. More... | |
odb::transaction * | get () |
Retrieve the odb transaction object. More... | |
Private Attributes | |
std::unique_ptr< odb::transaction > | transaction_ |
An optional transaction is an object that behave like an odb::transaction if there is no currently active transaction.
If a transaction is already in progress, this object actually does nothing, and calling commit() on it will do nothing.
The goal of this object is simple:
Definition at line 43 of file OptionalTransaction.hpp.
OptionalTransaction::OptionalTransaction | ( | odb::transaction_impl * | impl | ) |
Definition at line 27 of file OptionalTransaction.cpp.
OptionalTransaction::~OptionalTransaction | ( | ) |
Definition at line 33 of file OptionalTransaction.cpp.
void OptionalTransaction::commit | ( | ) |
Commit the transaction, if there was no currently active transaction at the time of this object's creation.
Definition at line 38 of file OptionalTransaction.cpp.
odb::transaction * OptionalTransaction::get | ( | ) |
Retrieve the odb transaction object.
Definition at line 44 of file OptionalTransaction.cpp.
|
private |
Definition at line 61 of file OptionalTransaction.hpp.