Joedb 10.5.0
The Journal-Only Embedded Database
Loading...
Searching...
No Matches
Generator.h
Go to the documentation of this file.
1#ifndef joedb_generator_Generator_declared
2#define joedb_generator_Generator_declared
3
5
6#include <ostream>
7
8namespace joedb::generator
9{
10 /// @ingroup compiler
12 {
13 protected:
21
22 const std::string dir_name;
23 const std::string file_name;
25
26 bool db_has_values() const;
27 bool table_has_field_type(Table_Id table_id, Type::Type_Id type_id) const;
28
29 void write_initial_comment(std::ostream &out);
30 void write_type(std::ostream &out, Type type, Type_Usage usage);
31 void write_tuple_type(std::ostream &out, const Compiler_Options::Index &index, bool reference, Type_Usage usage = Type_Usage::storage);
32
33 static const char *get_type_string(Type type);
34 static const char *get_cpp_type_string(Type type);
35 static const char *get_storage_type_string(Type type);
36
37 public:
39 (
40 std::string dir_name,
41 std::string file_name,
43 );
44
45 virtual void write(std::ostream &out) = 0;
46 void generate();
47
48 virtual ~Generator();
49 };
50}
51
52#endif
static const char * get_storage_type_string(Type type)
static const char * get_type_string(Type type)
void write_tuple_type(std::ostream &out, const Compiler_Options::Index &index, bool reference, Type_Usage usage=Type_Usage::storage)
static const char * get_cpp_type_string(Type type)
const std::string file_name
Definition Generator.h:23
const Compiler_Options & options
Definition Generator.h:24
const std::string dir_name
Definition Generator.h:22
void write_type(std::ostream &out, Type type, Type_Usage usage)
Definition Generator.cpp:52
virtual void write(std::ostream &out)=0
void write_initial_comment(std::ostream &out)
Definition Generator.cpp:33
bool table_has_field_type(Table_Id table_id, Type::Type_Id type_id) const
Definition Generator.cpp:23
Generator(std::string dir_name, std::string file_name, const Compiler_Options &options)
One code generator for each of the file generated by joedbc.
Definition Client_h.cpp:5