12 const std::pair<Table_Id, std::string> &table
26 out <<
"#ifndef JOEDB_INTROSPECTION\n";
28 if (
db.get_freedom(tid).get_used_count() >
Record_Id{0})
29 out <<
"#define JOEDB_INTROSPECTION(field_type, field_name, initial)\n";
31 out <<
"#define JOEDB_INTROSPECTION(field_type, field_name)\n";
35 for (
const auto &[fid, fname]:
db.get_fields(table.first))
37 out <<
"JOEDB_INTROSPECTION(";
55 if (
db.get_freedom(tid).get_used_count() >
Record_Id{0})
58 const Record_Id record_id{
db.get_freedom(tid).get_first_used()};
64 out <<
"\n#undef JOEDB_INTROSPECTION\n";
Type_Id get_type_id() const
const Compiler_Options & options
Generator(std::string dir_name, std::string file_name, const Compiler_Options &options)
void write_type(std::ostream &out, Type type, bool return_type, bool setter_type)
void write(std::ostream &out) override
introspection_h(const Compiler_Options &options, const std::pair< Table_Id, std::string > &table)
void namespace_write(std::ostream &out, const std::vector< std::string > &n, const char *delimiter)
void write_value(std::ostream &out, const Readable &readable, Table_Id table_id, Record_Id record_id, Field_Id field_id)
One code generator for each of the file generated by joedbc.