Joedb 10.2.1
The Journal-Only Embedded Database
|
Lock object that allows writing to a database managed by a joedb::Client. More...
#include <joedb/concurrency/Writable_Client.h>
Public Member Functions | |
Client_Lock (Writable_Client &client) | |
Client_Lock (const Client_Lock &)=delete | |
Client_Lock & | operator= (const Client_Lock &)=delete |
void | do_checkpoint () |
Checkpoint current journal, but do not push yet. | |
void | push_if_ahead () |
Push if the journal checkpoint is ahead of the connection checkpoint. | |
void | checkpoint_and_push () |
Checkpoint current journal, and push to the connection. | |
void | checkpoint_and_push_unlock () |
Confirm the transaction right before lock destruction. | |
void | unlock () |
Cancel the transaction right before lock destruction. | |
~Client_Lock () | |
The destructor unlocks the connection if necessary. | |
Protected Attributes | |
Writable_Client & | client |
const Journal_Lock | journal_lock |
bool | locked |
At the end of the life of this object, right before destruction, you should call either unlock to cancel the transaction, or push_unlock to confirm it. If you fail to do so, the destructor will call unlock. But calling unlock explicitly is better, if possible, because it can throw exceptions, unlike the destructor.
Definition at line 172 of file Writable_Client.h.
|
inline |
Definition at line 180 of file Writable_Client.h.
|
delete |
|
inline |
Definition at line 243 of file Writable_Client.h.
|
inline |
Unlike push_unlock, you can call this function multiple times during the life of the lock.
Definition at line 212 of file Writable_Client.h.
|
inline |
Destruction should happen right after this function. Do not call any other member function after this one.
Definition at line 223 of file Writable_Client.h.
|
inline |
Definition at line 192 of file Writable_Client.h.
|
delete |
|
inline |
This function keeps the connection locked
Definition at line 201 of file Writable_Client.h.
|
inline |
Destruction should happen right after this function. Do not call any other member function after this one.
Definition at line 235 of file Writable_Client.h.
|
protected |
Definition at line 175 of file Writable_Client.h.
|
protected |
Definition at line 176 of file Writable_Client.h.
|
protected |
Definition at line 177 of file Writable_Client.h.