Joedb 9.1.4
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Dump_Connection_Builder.h
Go to the documentation of this file.
1#ifndef joedb_Dump_Connection_Builder
2#define joedb_Dump_Connection_Builder
3
6#include "joedb/Multiplexer.h"
8
9namespace joedb
10{
11 /// @ingroup ui
12 template <typename Dump_Writable> class Dump_Connection_Data
13 {
14 protected:
16 Dump_Writable dump_writable;
18
19 public:
20 Dump_Connection_Data(std::ostream &out):
23 {
24 }
25 };
26
27 /// @ingroup ui
28 template<typename Dump_Writable> class Dump_Connection_Builder:
29 private Dump_Connection_Data<Dump_Writable>,
30 private Writable_Connection,
32 {
33 private:
34 bool mute_during_handshake;
35
36 public:
37 Dump_Connection_Builder(std::ostream &out):
38 Dump_Connection_Data<Dump_Writable>(out),
40 mute_during_handshake(false)
41 {
42 }
43
44 int get_max_parameters() const final {return 1;}
45 const char *get_name() const final {return this->dump_writable.get_name();}
46 const char *get_parameters_description() const final {return "[tail]";}
47
48 //////////////////////////////////////////////////////////////////////////
49 Connection &build(int argc, char **argv, Buffered_File *file) final
50 //////////////////////////////////////////////////////////////////////////
51 {
52 mute_during_handshake = argc > 0;
53
54 if (mute_during_handshake)
56
57 return *this;
58 }
59
60 //////////////////////////////////////////////////////////////////////////
61 int64_t handshake
62 //////////////////////////////////////////////////////////////////////////
63 (
64 Readonly_Journal &client_journal,
65 bool contentcheck
66 ) override
67 {
68 const int64_t result = Writable_Connection::handshake
69 (
70 client_journal,
71 contentcheck
72 );
73
74 if (mute_during_handshake)
76
77 return result;
78 }
79 };
80}
81
82#endif
const char * get_parameters_description() const final
int64_t handshake(Readonly_Journal &client_journal, bool contentcheck) override
Called during Client construction.
Connection & build(int argc, char **argv, Buffered_File *file) final
const char * get_name() const final
void set_start_index(size_t index)
Definition Multiplexer.h:26
int64_t handshake(Readonly_Journal &client_journal, bool contentcheck) override
Called during Client construction.
Definition Blob.h:7