Joedb 9.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Readable.h
Go to the documentation of this file.
1#ifndef joedb_Readable_declared
2#define joedb_Readable_declared
3
4#include "joedb/Type.h"
5
6#include <map>
7#include <string>
8
9namespace joedb
10{
11 class Compact_Freedom_Keeper;
12
13 /// @ingroup joedb
15 {
16 private:
17 static const std::string default_table_name;
18 static const std::string default_field_name;
19
20 public:
21 virtual const std::map<Table_Id, std::string> &get_tables() const = 0;
22 virtual const std::map<Field_Id, std::string> &get_fields
23 (
24 Table_Id table_id
25 ) const = 0;
26 virtual const Type &get_field_type
27 (
28 Table_Id table_id,
29 Field_Id field_id
30 ) const = 0;
31
32 virtual const Compact_Freedom_Keeper &get_freedom(Table_Id table_id) const = 0;
33 #define TYPE_MACRO(type, return_type, type_id, R, W)\
34 virtual const type &get_##type_id\
35 (\
36 Table_Id table_id,\
37 Record_Id record_id,\
38 Field_Id field_id\
39 ) const = 0;
40 #include "joedb/TYPE_MACRO.h"
41
42 // TODO: iterators to iterate over table rows?
43
44 Table_Id find_table(const std::string &name) const;
45 Field_Id find_field(Table_Id table_id, const std::string &name) const;
46 const std::string &get_table_name(Table_Id table_id) const;
47 const std::string &get_field_name
48 (
49 Table_Id table_id,
50 Field_Id field_id
51 ) const;
53 bool is_used(Table_Id table_id, Record_Id record_id) const;
54
55 virtual ~Readable();
56 };
57}
58
59#endif
virtual const Type & get_field_type(Table_Id table_id, Field_Id field_id) const =0
const std::string & get_field_name(Table_Id table_id, Field_Id field_id) const
Definition Readable.cpp:54
Field_Id find_field(Table_Id table_id, const std::string &name) const
Definition Readable.cpp:22
bool is_used(Table_Id table_id, Record_Id record_id) const
Definition Readable.cpp:83
virtual const Compact_Freedom_Keeper & get_freedom(Table_Id table_id) const =0
virtual const std::map< Field_Id, std::string > & get_fields(Table_Id table_id) const =0
const std::string & get_table_name(Table_Id table_id) const
Definition Readable.cpp:38
Table_Id find_table(const std::string &name) const
Definition Readable.cpp:12
Record_Id get_last_record_id(Table_Id table_id) const
Definition Readable.cpp:74
virtual const std::map< Table_Id, std::string > & get_tables() const =0
virtual ~Readable()
Definition Blob.h:7