added meta table macro and removed unused query_macro
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#ifndef MATADOR_META_TABLE_MACRO_HPP
|
||||
#define MATADOR_META_TABLE_MACRO_HPP
|
||||
|
||||
#include "matador/utils/macro_map.hpp"
|
||||
|
||||
#include "matador/query/table_column.hpp"
|
||||
#include "matador/query/table.hpp"
|
||||
|
||||
#define FIELD(FIELD_NAME) const matador::query::table_column& FIELD_NAME;
|
||||
#define INIT_FIELD(FIELD_NAME) , FIELD_NAME(*column_by_name(*this, #FIELD_NAME))
|
||||
#define FIELD_STRING(FIELD_NAME) #FIELD_NAME,
|
||||
|
||||
#define META_TABLE(TABLE_NAME, VARIABLE_NAME, ...) \
|
||||
namespace matador::query::meta { \
|
||||
namespace internal { \
|
||||
class TABLE_NAME##_table : public table { \
|
||||
public: \
|
||||
TABLE_NAME##_table() \
|
||||
: table(#TABLE_NAME, {MAP(FIELD_STRING, __VA_ARGS__)}) \
|
||||
MAP(INIT_FIELD, __VA_ARGS__) \
|
||||
{} \
|
||||
MAP(FIELD, __VA_ARGS__) \
|
||||
}; } \
|
||||
static const internal:: TABLE_NAME##_table VARIABLE_NAME; \
|
||||
}
|
||||
|
||||
#endif //MATADOR_META_TABLE_MACRO_HPP
|
||||
Reference in New Issue
Block a user