Joedb
9.1.4
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
src
joedb
ui
Interpreter.h
Go to the documentation of this file.
1
#ifndef joedb_Interpreter_declared
2
#define joedb_Interpreter_declared
3
4
#include "
joedb/ui/Command_Interpreter.h
"
5
#include "
joedb/ui/Readable_Command_Processor.h
"
6
#include "
joedb/ui/Writable_Command_Processor.h
"
7
#include "
joedb/ui/Readable_Writable_Command_Processor.h
"
8
#include "
joedb/ui/Blob_Reader_Command_Processor.h
"
9
10
#include <memory>
11
12
namespace
joedb
13
{
14
/// @ingroup ui
15
class
Readable_Interpreter
:
public
Command_Interpreter
16
{
17
protected
:
18
Readable_Command_Processor
readable_command_processor
;
19
std::unique_ptr<Blob_Reader_Command_Processor>
blob_reader_command_processor
;
20
21
public
:
22
Readable_Interpreter
23
(
24
const
Readable
&readable,
25
const
Buffered_File
*blob_reader
26
):
27
readable_command_processor
(readable)
28
{
29
add_processor
(
readable_command_processor
);
30
if
(blob_reader)
31
{
32
blob_reader_command_processor
= std::make_unique<Blob_Reader_Command_Processor>(*blob_reader);
33
add_processor
(*
blob_reader_command_processor
);
34
}
35
}
36
};
37
38
/// @ingroup ui
39
class
Writable_Interpreter
:
public
Command_Interpreter
40
{
41
protected
:
42
Writable_Command_Processor
writable_command_processor
;
43
44
public
:
45
Writable_Interpreter
(
Writable
&writable,
Writable
&blob_writer):
46
writable_command_processor
(writable, blob_writer)
47
{
48
add_processor
(
writable_command_processor
);
49
}
50
};
51
52
/// @ingroup ui
53
class
Interpreter
:
public
Command_Interpreter
54
{
55
private
:
56
std::unique_ptr<Blob_Reader_Command_Processor> blob_reader_command_processor;
57
Writable_Command_Processor
writable_command_processor;
58
Readable_Writable_Command_Processor
readable_writable_command_processor;
59
60
public
:
61
Interpreter
62
(
63
const
Readable
&readable,
64
Writable
&writable,
65
const
Buffered_File
*blob_reader,
66
Writable
&blob_writer,
67
size_t
max_record_id
68
):
69
writable_command_processor(writable, blob_writer),
70
readable_writable_command_processor
71
(
72
readable,
73
writable,
74
max_record_id
75
)
76
{
77
if
(blob_reader)
78
{
79
blob_reader_command_processor = std::make_unique<Blob_Reader_Command_Processor>(*blob_reader);
80
add_processor
(*blob_reader_command_processor);
81
}
82
add_processor
(writable_command_processor);
83
add_processor
(readable_writable_command_processor);
84
}
85
};
86
}
87
88
#endif
Blob_Reader_Command_Processor.h
Command_Interpreter.h
Readable_Command_Processor.h
Readable_Writable_Command_Processor.h
Writable_Command_Processor.h
joedb::Buffered_File
Definition
Buffered_File.h:18
joedb::Command_Interpreter
Definition
Command_Interpreter.h:15
joedb::Command_Interpreter::add_processor
void add_processor(Command_Processor &processor)
Definition
Command_Interpreter.cpp:94
joedb::Interpreter
Definition
Interpreter.h:54
joedb::Interpreter::Interpreter
Interpreter(const Readable &readable, Writable &writable, const Buffered_File *blob_reader, Writable &blob_writer, size_t max_record_id)
Definition
Interpreter.h:62
joedb::Readable_Command_Processor
Definition
Readable_Command_Processor.h:13
joedb::Readable_Interpreter
Definition
Interpreter.h:16
joedb::Readable_Interpreter::readable_command_processor
Readable_Command_Processor readable_command_processor
Definition
Interpreter.h:18
joedb::Readable_Interpreter::Readable_Interpreter
Readable_Interpreter(const Readable &readable, const Buffered_File *blob_reader)
Definition
Interpreter.h:23
joedb::Readable_Interpreter::blob_reader_command_processor
std::unique_ptr< Blob_Reader_Command_Processor > blob_reader_command_processor
Definition
Interpreter.h:19
joedb::Readable_Writable_Command_Processor
Definition
Readable_Writable_Command_Processor.h:11
joedb::Readable
Definition
Readable.h:16
joedb::Writable_Command_Processor
Definition
Writable_Command_Processor.h:12
joedb::Writable_Interpreter
Definition
Interpreter.h:40
joedb::Writable_Interpreter::Writable_Interpreter
Writable_Interpreter(Writable &writable, Writable &blob_writer)
Definition
Interpreter.h:45
joedb::Writable_Interpreter::writable_command_processor
Writable_Command_Processor writable_command_processor
Definition
Interpreter.h:42
joedb::Writable
Definition
Writable.h:22
joedb
Definition
Blob.h:7
Generated by
1.9.8