Joedb 9.1.4
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 ////////////////////////////////////////////////////////////////////////////
15 ////////////////////////////////////////////////////////////////////////////
16 {
17 private:
18 static const std::string default_table_name;
19 static const std::string default_field_name;
20
21 public:
22 virtual const std::map<Table_Id, std::string> &get_tables() const = 0;
23 virtual const std::map<Field_Id, std::string> &get_fields
24 (
25 Table_Id table_id
26 ) const = 0;
27 virtual const Type &get_field_type
28 (
29 Table_Id table_id,
30 Field_Id field_id
31 ) const = 0;
32
33 virtual const Compact_Freedom_Keeper &get_freedom(Table_Id table_id) const = 0;
34 #define TYPE_MACRO(type, return_type, type_id, R, W)\
35 virtual const type &get_##type_id\
36 (\
37 Table_Id table_id,\
38 Record_Id record_id,\
39 Field_Id field_id\
40 ) const = 0;
41 #include "joedb/TYPE_MACRO.h"
42
43 // TODO: iterators to iterate over table rows?
44
45 Table_Id find_table(const std::string &name) const;
46 Field_Id find_field(Table_Id table_id, const std::string &name) const;
47 const std::string &get_table_name(Table_Id table_id) const;
48 const std::string &get_field_name
49 (
50 Table_Id table_id,
51 Field_Id field_id
52 ) const;
54 bool is_used(Table_Id table_id, Record_Id record_id) const;
55
56 virtual ~Readable();
57 };
58}
59
60#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