Joedb 9.1.3
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Public Member Functions | Static Protected Member Functions | List of all members
joedb::Connection Class Reference

#include <joedb/concurrency/Connection.h>

Inheritance diagram for joedb::Connection:
Inheritance graph
[legend]

Public Member Functions

virtual int64_t handshake (Readonly_Journal &client_journal, bool content_check)
 Called during Client construction.
 
virtual int64_t pull (Writable_Journal &client_journal, std::chrono::milliseconds wait=std::chrono::milliseconds(0))
 Pull new data from the connection.
 
virtual int64_t lock_pull (Writable_Journal &client_journal, std::chrono::milliseconds wait=std::chrono::milliseconds(0))
 Fused lock_pull, executed at the start of a write transaction.
 
virtual int64_t get_checkpoint (Readonly_Journal &client_journal, std::chrono::milliseconds wait=std::chrono::milliseconds(0))
 Get new connection checkpoint without pulling.
 
virtual int64_t push_until (Readonly_Journal &client_journal, int64_t from_checkpoint, int64_t until_checkpoint, bool unlock_after)
 Push new data to the connction.
 
int64_t push (Readonly_Journal &client_journal, int64_t from_checkpoint, bool unlock_after)
 Shortcut to call push_until until the client checkpoint.
 
virtual void unlock ()
 Can be used to cancel a transaction without pushing.
 
virtual ~Connection ()
 

Static Protected Member Functions

static void content_mismatch ()
 

Detailed Description

Definition at line 11 of file Connection.h.

Constructor & Destructor Documentation

◆ ~Connection()

joedb::Connection::~Connection ( )
virtualdefault

Member Function Documentation

◆ content_mismatch()

void joedb::Connection::content_mismatch ( )
staticprotected

Definition at line 5 of file Connection.cpp.

◆ get_checkpoint()

int64_t joedb::Connection::get_checkpoint ( Readonly_Journal client_journal,
std::chrono::milliseconds  wait = std::chrono::milliseconds(0) 
)
virtual
Return values
server_checkpoint

Reimplemented in joedb::Server_Connection, and joedb::Pullonly_Journal_Connection.

Definition at line 37 of file Connection.cpp.

◆ handshake()

int64_t joedb::Connection::handshake ( Readonly_Journal client_journal,
bool  content_check 
)
virtual
Parameters
client_journalmay be used to check matching content
content_checkindicates whether matching content is tested
Return values
server_checkpoint

Reimplemented in joedb::Pullonly_Journal_Connection, joedb::Server_Connection, joedb::Server_File, joedb::Writable_Connection, and joedb::Dump_Connection_Builder< Dump_Writable >.

Definition at line 10 of file Connection.cpp.

◆ lock_pull()

int64_t joedb::Connection::lock_pull ( Writable_Journal client_journal,
std::chrono::milliseconds  wait = std::chrono::milliseconds(0) 
)
virtual
Return values
server_checkpoint

Reimplemented in joedb::Server_File, joedb::Server_Connection, joedb::Pullonly_Journal_Connection, and joedb::Journal_Connection.

Definition at line 28 of file Connection.cpp.

◆ pull()

int64_t joedb::Connection::pull ( Writable_Journal client_journal,
std::chrono::milliseconds  wait = std::chrono::milliseconds(0) 
)
virtual
Parameters
client_journaljournal to pull into
waitduration during which the connection may wait for new data if the pull would otherwise be empty
Return values
server_checkpoint

Reimplemented in joedb::Server_Connection, joedb::Server_File, and joedb::Pullonly_Journal_Connection.

Definition at line 19 of file Connection.cpp.

◆ push()

int64_t joedb::Connection::push ( Readonly_Journal client_journal,
int64_t  from_checkpoint,
bool  unlock_after 
)
inline
Return values
server_checkpoint

Definition at line 66 of file Connection.h.

◆ push_until()

int64_t joedb::Connection::push_until ( Readonly_Journal client_journal,
int64_t  from_checkpoint,
int64_t  until_checkpoint,
bool  unlock_after 
)
virtual

◆ unlock()

void joedb::Connection::unlock ( )
virtual

Reimplemented in joedb::Journal_Connection, and joedb::Server_Connection.

Definition at line 57 of file Connection.cpp.


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