OpenLexocad
28.0
|
#include <AutoTransaction.h>
Public Member Functions | |
TransactionLocker (bool lock=true) | |
~TransactionLocker () | |
void | activate (bool enable) |
bool | isActive () const |
Check if the locker is active. More... | |
Static Public Member Functions | |
static bool | isLocked () |
Check if transaction is being locked. More... | |
Friends | |
class | CoreApplication |
Helper class to lock a transaction from being closed or aborted.
The helper class is used to protect some critical transaction from being closed prematurely, e.g. when deleting some object.
Core::TransactionLocker::TransactionLocker | ( | bool | lock = true | ) |
Constructor
lock | whether to activate the lock |
Core::TransactionLocker::~TransactionLocker | ( | ) |
Destructor Unlock the transaction is this locker is active
void Core::TransactionLocker::activate | ( | bool | enable | ) |
Activate or deactivate this locker
enable | whether to activate the locker |
An internal counter is used to support recursive locker. When activated, the current active transaction cannot be closed or aborted. But the closing call (Application::closeActiveTransaction()) will be remembered, and performed when the internal lock counter reaches zero.
|
inline |
Check if the locker is active.
|
static |
Check if transaction is being locked.
|
friend |