Joedb 9.1.4
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Public Member Functions | List of all members
settings::Client_Lock Class Reference

For more flexibility than the transaction lambda. More...

#include <settings/Client.h>

Inheritance diagram for settings::Client_Lock:
Inheritance graph
[legend]
Collaboration diagram for settings::Client_Lock:
Collaboration graph
[legend]

Public Member Functions

 Client_Lock (Client &client)
 
Writable_Databaseget_database ()
 
- Public Member Functions inherited from joedb::Client_Lock
 Client_Lock (Client &client)
 
 Client_Lock (const Client_Lock &)=delete
 
Client_Lockoperator= (const Client_Lock &)=delete
 
void push ()
 Checkpoint current journal, and push to the connection.
 
void push_unlock ()
 Confirm the transaction right before lock destruction.
 
void unlock ()
 Cancel the transaction right before lock destruction.
 
 ~Client_Lock ()
 

Additional Inherited Members

- Protected Member Functions inherited from joedb::Client_Lock
bool is_locked () const
 
- Protected Attributes inherited from joedb::Client_Lock
Clientclient
 
Journal_Lock journal_lock
 

Detailed Description

See joedb::Client_Lock for more information

static int client_lock(int argc, char **argv)
{
tutorial::File_Client client("tutorial.joedb");
{
lock.get_database().write_comment("Hello");
lock.push();
lock.get_database().write_comment("Goodbye");
lock.get_database().write_timestamp();
lock.push_unlock();
}
return 0;
}
int main(int argc, char **argv)
{
return joedb::main_exception_catcher(client_lock, argc, argv);
}
Client & client
Definition Client.h:166
For more flexibility than the transaction lambda.
Definition Client.h:121
Shortcut to directly build a Client from a file name.
Definition File_Client.h:39
int main()
int main_exception_catcher(int(*main)(int, char **), int argc, char **argv)
Catch exception from main.

Definition at line 120 of file Client.h.

Constructor & Destructor Documentation

◆ Client_Lock()

settings::Client_Lock::Client_Lock ( Client client)
inline

Definition at line 123 of file Client.h.

Member Function Documentation

◆ get_database()

Writable_Database & settings::Client_Lock::get_database ( )
inline

Definition at line 127 of file Client.h.


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