custom-macros.hh
上传用户:clovervx
上传日期:2010-03-30
资源大小:787k
文件大小:1318k
- return equal_list(d, " = ", mysql_quote, sc);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- bool i1) const {
- return equal_list(d, c, mysql_quote, i1);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- ##NAME##_enum i1) const {
- return equal_list(d, c, mysql_quote, i1);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- vector<bool> *i) const {
- return equal_list(d, c, mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- sql_cmp_type sc) const {
- return equal_list(d, c, mysql_quote, sc);
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- bool i1) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- ##NAME##_enum i1) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- sql_cmp_type sc) const;
- NAME##_value_list<quote_type0> value_list() const {
- return value_list(",", mysql_quote);}
- NAME##_value_list<quote_type0> value_list(cchar *d) const {
- return value_list(d, mysql_quote);}
- template <class Manip>
- NAME##_value_list<Manip> value_list(cchar *d, Manip m) const;
- NAME##_field_list<do_nothing_type0> field_list() const {
- return field_list(",", mysql_do_nothing);}
- NAME##_field_list<do_nothing_type0> field_list(cchar *d) const {
- return field_list(d, mysql_do_nothing);}
- template <class Manip>
- NAME##_field_list<Manip> field_list(cchar *d, Manip m) const;
- NAME##_equal_list<quote_type0> equal_list(cchar *d = ",",
- cchar *c = " = ") const{
- return equal_list(d, c, mysql_quote);}
- template <class Manip>
- NAME##_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m) const;
- };
- char *##NAME##::names[] = {
- N1
- };
- char *##NAME##::_table = #NAME ;
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, bool i1)
- {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(1, false);
- if (i1) (*include)[0]=true;
- }
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(1, false);
- (*include)[i1]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, bool i1) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(1, false);
- if (i1) (*include)[0]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(1, false);
- (*include)[i1]=true;
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip>::NAME##_cus_equal_list
- (const NAME *o, cchar *d, cchar *c, Manip m, bool i1) {
- delem = d;
- comp = c;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(1, false);
- if (i1) (*include)[0]=true;
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip>::NAME##_cus_equal_list
- (const NAME *o, cchar *d, cchar *c, Manip m, ##NAME##_enum i1) {
- delem = d;
- comp = c;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(1, false);
- (*include)[i1]=true;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_value_list<Manip>& obj) {
- s << obj.manip << obj.obj->##I1;
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_field_list<Manip>& obj) {
- s << obj.manip << obj.obj->names[0];
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_equal_list<Manip>& obj) {
- s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->##I1;
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_value_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.manip << obj.obj->##I1;
- }
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_field_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.manip << obj.obj->names[0];
- }
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_equal_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->##I1;
- }
- return s;
- }
- template <class Manip>
- inline NAME##_value_list<Manip> NAME##::value_list(cchar *d, Manip m) const {
- return NAME##_value_list<Manip> (this, d, m);
- }
- template <class Manip>
- inline NAME##_field_list<Manip> NAME##::field_list(cchar *d, Manip m) const {
- return NAME##_field_list<Manip> (this, d, m);
- }
- template <class Manip>
- inline NAME##_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m) const {
- return NAME##_equal_list<Manip> (this, d, c, m);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip> NAME##::value_list(cchar *d, Manip m,
- bool i1) const {
- return NAME##_cus_value_list<Manip> (this, d, m, i1);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip> NAME##::field_list(cchar *d, Manip m,
- bool i1) const {
- return NAME##_cus_field_list<Manip> (this, d, m, i1);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m,
- bool i1) const {
- return NAME##_cus_equal_list<Manip> (this, d, c, m, i1);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip> NAME##::value_list(cchar *d, Manip m,
- ##NAME##_enum i1) const {
- return NAME##_cus_value_list<Manip> (this, d, m, i1);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip> NAME##::field_list(cchar *d, Manip m,
- ##NAME##_enum i1) const {
- return NAME##_cus_field_list<Manip> (this, d, m, i1);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m,
- ##NAME##_enum i1) const {
- return NAME##_cus_equal_list<Manip> (this, d, c, m, i1);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip>
- NAME##::value_list(cchar *d, Manip m, sql_cmp_type sc) const {
- sql_compare_type_def_##CMP (NAME, value, NUM);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip>
- NAME##::field_list(cchar *d, Manip m, sql_cmp_type sc) const {
- sql_compare_type_def_##CMP (NAME, field, NUM);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip>
- NAME##::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type sc) const {
- sql_compare_type_defe_##CMP (NAME, equal, NUM);
- }
- template <sql_dummy_type dummy>
- void populate_##NAME (NAME *s, const MysqlRow &row) {
- s->##I1 = row[ O1 ];
- }
- inline NAME##::##NAME (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- inline void NAME##::set (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- sql_COMPARE__##CMP##(NAME, I1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
- #define sql_create_basic_1(NAME, CMP, CONTR, T1, I1)
- sql_create_basic_c_order_1(NAME, CMP, CONTR, T1, I1, 0)
- #define sql_create_1(NAME, CMP, CONTR, T1, I1)
- sql_create_complete_1(NAME, CMP, CONTR, T1, I1, #I1, 0)
- #define sql_create_c_order_1(NAME, CMP, CONTR, T1, I1, O1)
- sql_create_complete_1(NAME, CMP, CONTR, T1, I1, #I1, O1)
- #define sql_create_c_names_1(NAME, CMP, CONTR, T1, I1, N1)
- sql_create_complete_1(NAME, CMP, CONTR, T1, I1, N1, 0)
- // ---------------------------------------------------
- // End Create 1
- // ---------------------------------------------------
- // ---------------------------------------------------
- // Begin Create 2
- // ---------------------------------------------------
- #define sql_create_basic_c_order_2(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2)
- struct NAME;
- template <sql_dummy_type dummy> int sql_compare_##NAME (const NAME &, const NAME &);
- struct NAME {
- T1 I1;
- T2 I2;
- NAME () {}
- NAME (const MysqlRow &row);
- sql_compare_define_##CMP(NAME, T1, I1, T2, I2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- };
- template <sql_dummy_type dummy>
- void populate_##NAME (NAME *s, const MysqlRow &row) {
- s->##I1 = row[ O1 ];
- s->##I2 = row[ O2 ];
- }
- inline NAME##::##NAME (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- sql_COMPARE__##CMP##(NAME, I1, I2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
- #define sql_create_complete_2(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2)
- struct NAME;
- enum NAME##_enum {
- NAME##_##I1,
- NAME##_##I2
- ,NAME##_NULL
- };
- template <class Manip>
- class NAME##_value_list {
- /*friend ostream& operator << <> (ostream&, const NAME##_value_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- public:
- NAME##_value_list (const NAME *o, cchar *d, Manip m)
- : obj(o), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_##field_list {
- /* friend ostream& operator << <> (ostream&, const NAME##_field_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- public:
- NAME##_field_list (const NAME *o, cchar *d, Manip m)
- : obj(o), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_equal_list {
- /* friend ostream& operator << <> (ostream&, const NAME##_equal_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- cchar *comp;
- Manip manip;
- public:
- NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m)
- : obj(o), delem(d), comp(c), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_value_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_value_list<Manip>&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- vector<bool> *include;
- bool del_vector;
- public:
- ~##NAME##_cus_value_list () {if (del_vector) delete include;}
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2);
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2);
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,vector<bool>)
- : obj(o), include(i), del_vector(false), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_field_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_field_list<Manip>&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- vector<bool> *include;
- bool del_vector;
- public:
- ~##NAME##_cus_field_list () {if (del_vector) delete include;}
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2);
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2);
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, vector<bool> *i)
- : obj(o), include(i), del_vector(false), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_equal_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_equal_list<Manip>&); */
- public:
- const NAME *obj;
- vector<bool> *include;
- bool del_vector;
- cchar *delem;
- cchar *comp;
- Manip manip;
- public:
- ~##NAME##_##cus_equal_list () {if (del_vector) delete include;}
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2);
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, ##NAME##_enum i1, ##NAME##_enum i2);
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, vector<bool> *i)
- : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}
- };
- template <sql_dummy_type dummy> int sql_compare_##NAME (const NAME &, const NAME &);
- struct NAME {
- T1 I1;
- T2 I2;
- NAME () {}
- NAME (const MysqlRow &row);
- void set (const MysqlRow &row);
- sql_compare_define_##CMP(NAME, T1, I1, T2, I2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- static char *names[];
- static char *_table;
- static char *& table() {return _table;}
- /* cus_data */
- NAME##_cus_value_list<quote_type0> value_list(bool i1, bool i2 = false) const {
- return value_list(",", mysql_quote, i1, i2);
- }
- NAME##_cus_value_list<quote_type0> value_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL) const {
- return value_list(",", mysql_quote, i1, i2);
- }
- NAME##_cus_value_list<quote_type0> value_list(vector<bool> *i) const {
- return value_list(",", mysql_quote, i);
- }
- NAME##_cus_value_list<quote_type0> value_list(sql_cmp_type sc) const {
- return value_list(",", mysql_quote, sc);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d, bool i1, bool i2 = false) const {
- return value_list(d, mysql_quote, i1, i2);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d, ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL) const {
- return value_list(d, mysql_quote, i1, i2);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d,
- vector<bool> *i) const {
- return value_list(d, mysql_quote, i);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d,
- sql_cmp_type sc) const {
- return value_list(d, mysql_quote, sc);
- }
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- bool i1, bool i2 = false) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- sql_cmp_type sc) const;
- /* cus field */
- NAME##_cus_field_list<do_nothing_type0> field_list(bool i1, bool i2 = false) const {
- return field_list(",", mysql_do_nothing, i1, i2);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL) const {
- return field_list(",", mysql_do_nothing, i1, i2);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(vector<bool> *i) const {
- return field_list(",", mysql_do_nothing, i);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(sql_cmp_type sc) const
- {
- return field_list(",", mysql_do_nothing, sc);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- bool i1, bool i2 = false) const {
- return field_list(d, mysql_do_nothing, i1, i2);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL) const {
- return field_list(d, mysql_do_nothing, i1, i2);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- vector<bool> *i) const {
- return field_list(d, mysql_do_nothing, i);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- sql_cmp_type sc) const {
- return field_list(d, mysql_do_nothing, sc);
- }
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- bool i1, bool i2 = false) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- sql_cmp_type sc) const;
- /* cus equal */
- NAME##_cus_equal_list<quote_type0> equal_list(bool i1, bool i2 = false) const {
- return equal_list(",", " = ", mysql_quote, i1, i2);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL) const {
- return equal_list(",", " = ", mysql_quote, i1, i2);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(vector<bool> *i) const {
- return equal_list(",", " = ", mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(sql_cmp_type sc) const {
- return equal_list(",", " = ", mysql_quote, sc);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, bool i1, bool i2 = false) const {
- return equal_list(d, " = ", mysql_quote, i1, i2);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL) const {
- return equal_list(d, " = ", mysql_quote, i1, i2);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d,
- vector<bool> *i) const {
- return equal_list(d, " = ", mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d,
- sql_cmp_type sc) const {
- return equal_list(d, " = ", mysql_quote, sc);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- bool i1, bool i2 = false) const {
- return equal_list(d, c, mysql_quote, i1, i2);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL) const {
- return equal_list(d, c, mysql_quote, i1, i2);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- vector<bool> *i) const {
- return equal_list(d, c, mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- sql_cmp_type sc) const {
- return equal_list(d, c, mysql_quote, sc);
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- bool i1, bool i2 = false) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- sql_cmp_type sc) const;
- NAME##_value_list<quote_type0> value_list() const {
- return value_list(",", mysql_quote);}
- NAME##_value_list<quote_type0> value_list(cchar *d) const {
- return value_list(d, mysql_quote);}
- template <class Manip>
- NAME##_value_list<Manip> value_list(cchar *d, Manip m) const;
- NAME##_field_list<do_nothing_type0> field_list() const {
- return field_list(",", mysql_do_nothing);}
- NAME##_field_list<do_nothing_type0> field_list(cchar *d) const {
- return field_list(d, mysql_do_nothing);}
- template <class Manip>
- NAME##_field_list<Manip> field_list(cchar *d, Manip m) const;
- NAME##_equal_list<quote_type0> equal_list(cchar *d = ",",
- cchar *c = " = ") const{
- return equal_list(d, c, mysql_quote);}
- template <class Manip>
- NAME##_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m) const;
- };
- char *##NAME##::names[] = {
- N1 ,
- N2
- };
- char *##NAME##::_table = #NAME ;
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, bool i1, bool i2)
- {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(2, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- }
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(2, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, bool i1, bool i2) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(2, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(2, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip>::NAME##_cus_equal_list
- (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2) {
- delem = d;
- comp = c;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(2, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip>::NAME##_cus_equal_list
- (const NAME *o, cchar *d, cchar *c, Manip m, ##NAME##_enum i1, ##NAME##_enum i2) {
- delem = d;
- comp = c;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(2, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_value_list<Manip>& obj) {
- s << obj.manip << obj.obj->##I1 << obj.delem;
- s << obj.manip << obj.obj->##I2;
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_field_list<Manip>& obj) {
- s << obj.manip << obj.obj->names[0] << obj.delem;
- s << obj.manip << obj.obj->names[1];
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_equal_list<Manip>& obj) {
- s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->##I1 << obj.delem;
- s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->##I2;
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_value_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.manip << obj.obj->##I1;
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->##I2;
- }
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_field_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.manip << obj.obj->names[0];
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->names[1];
- }
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_equal_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->##I1;
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->##I2;
- }
- return s;
- }
- template <class Manip>
- inline NAME##_value_list<Manip> NAME##::value_list(cchar *d, Manip m) const {
- return NAME##_value_list<Manip> (this, d, m);
- }
- template <class Manip>
- inline NAME##_field_list<Manip> NAME##::field_list(cchar *d, Manip m) const {
- return NAME##_field_list<Manip> (this, d, m);
- }
- template <class Manip>
- inline NAME##_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m) const {
- return NAME##_equal_list<Manip> (this, d, c, m);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip> NAME##::value_list(cchar *d, Manip m,
- bool i1, bool i2) const {
- return NAME##_cus_value_list<Manip> (this, d, m, i1, i2);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip> NAME##::field_list(cchar *d, Manip m,
- bool i1, bool i2) const {
- return NAME##_cus_field_list<Manip> (this, d, m, i1, i2);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m,
- bool i1, bool i2) const {
- return NAME##_cus_equal_list<Manip> (this, d, c, m, i1, i2);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip> NAME##::value_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2) const {
- return NAME##_cus_value_list<Manip> (this, d, m, i1, i2);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip> NAME##::field_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2) const {
- return NAME##_cus_field_list<Manip> (this, d, m, i1, i2);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2) const {
- return NAME##_cus_equal_list<Manip> (this, d, c, m, i1, i2);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip>
- NAME##::value_list(cchar *d, Manip m, sql_cmp_type sc) const {
- sql_compare_type_def_##CMP (NAME, value, NUM);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip>
- NAME##::field_list(cchar *d, Manip m, sql_cmp_type sc) const {
- sql_compare_type_def_##CMP (NAME, field, NUM);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip>
- NAME##::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type sc) const {
- sql_compare_type_defe_##CMP (NAME, equal, NUM);
- }
- template <sql_dummy_type dummy>
- void populate_##NAME (NAME *s, const MysqlRow &row) {
- s->##I1 = row[ O1 ];
- s->##I2 = row[ O2 ];
- }
- inline NAME##::##NAME (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- inline void NAME##::set (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- sql_COMPARE__##CMP##(NAME, I1, I2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
- #define sql_create_basic_2(NAME, CMP, CONTR, T1, I1, T2, I2)
- sql_create_basic_c_order_2(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1)
- #define sql_create_2(NAME, CMP, CONTR, T1, I1, T2, I2)
- sql_create_complete_2(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1)
- #define sql_create_c_order_2(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2)
- sql_create_complete_2(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2)
- #define sql_create_c_names_2(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2)
- sql_create_complete_2(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1)
- // ---------------------------------------------------
- // End Create 2
- // ---------------------------------------------------
- // ---------------------------------------------------
- // Begin Create 3
- // ---------------------------------------------------
- #define sql_create_basic_c_order_3(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3)
- struct NAME;
- template <sql_dummy_type dummy> int sql_compare_##NAME (const NAME &, const NAME &);
- struct NAME {
- T1 I1;
- T2 I2;
- T3 I3;
- NAME () {}
- NAME (const MysqlRow &row);
- sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- };
- template <sql_dummy_type dummy>
- void populate_##NAME (NAME *s, const MysqlRow &row) {
- s->##I1 = row[ O1 ];
- s->##I2 = row[ O2 ];
- s->##I3 = row[ O3 ];
- }
- inline NAME##::##NAME (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- sql_COMPARE__##CMP##(NAME, I1, I2, I3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
- #define sql_create_complete_3(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3)
- struct NAME;
- enum NAME##_enum {
- NAME##_##I1,
- NAME##_##I2,
- NAME##_##I3
- ,NAME##_NULL
- };
- template <class Manip>
- class NAME##_value_list {
- /*friend ostream& operator << <> (ostream&, const NAME##_value_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- public:
- NAME##_value_list (const NAME *o, cchar *d, Manip m)
- : obj(o), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_##field_list {
- /* friend ostream& operator << <> (ostream&, const NAME##_field_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- public:
- NAME##_field_list (const NAME *o, cchar *d, Manip m)
- : obj(o), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_equal_list {
- /* friend ostream& operator << <> (ostream&, const NAME##_equal_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- cchar *comp;
- Manip manip;
- public:
- NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m)
- : obj(o), delem(d), comp(c), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_value_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_value_list<Manip>&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- vector<bool> *include;
- bool del_vector;
- public:
- ~##NAME##_cus_value_list () {if (del_vector) delete include;}
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3);
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3);
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,vector<bool>)
- : obj(o), include(i), del_vector(false), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_field_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_field_list<Manip>&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- vector<bool> *include;
- bool del_vector;
- public:
- ~##NAME##_cus_field_list () {if (del_vector) delete include;}
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3);
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3);
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, vector<bool> *i)
- : obj(o), include(i), del_vector(false), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_equal_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_equal_list<Manip>&); */
- public:
- const NAME *obj;
- vector<bool> *include;
- bool del_vector;
- cchar *delem;
- cchar *comp;
- Manip manip;
- public:
- ~##NAME##_##cus_equal_list () {if (del_vector) delete include;}
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3);
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3);
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, vector<bool> *i)
- : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}
- };
- template <sql_dummy_type dummy> int sql_compare_##NAME (const NAME &, const NAME &);
- struct NAME {
- T1 I1;
- T2 I2;
- T3 I3;
- NAME () {}
- NAME (const MysqlRow &row);
- void set (const MysqlRow &row);
- sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- static char *names[];
- static char *_table;
- static char *& table() {return _table;}
- /* cus_data */
- NAME##_cus_value_list<quote_type0> value_list(bool i1, bool i2 = false, bool i3 = false) const {
- return value_list(",", mysql_quote, i1, i2, i3);
- }
- NAME##_cus_value_list<quote_type0> value_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL) const {
- return value_list(",", mysql_quote, i1, i2, i3);
- }
- NAME##_cus_value_list<quote_type0> value_list(vector<bool> *i) const {
- return value_list(",", mysql_quote, i);
- }
- NAME##_cus_value_list<quote_type0> value_list(sql_cmp_type sc) const {
- return value_list(",", mysql_quote, sc);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false) const {
- return value_list(d, mysql_quote, i1, i2, i3);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d, ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL) const {
- return value_list(d, mysql_quote, i1, i2, i3);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d,
- vector<bool> *i) const {
- return value_list(d, mysql_quote, i);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d,
- sql_cmp_type sc) const {
- return value_list(d, mysql_quote, sc);
- }
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- bool i1, bool i2 = false, bool i3 = false) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- sql_cmp_type sc) const;
- /* cus field */
- NAME##_cus_field_list<do_nothing_type0> field_list(bool i1, bool i2 = false, bool i3 = false) const {
- return field_list(",", mysql_do_nothing, i1, i2, i3);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL) const {
- return field_list(",", mysql_do_nothing, i1, i2, i3);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(vector<bool> *i) const {
- return field_list(",", mysql_do_nothing, i);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(sql_cmp_type sc) const
- {
- return field_list(",", mysql_do_nothing, sc);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- bool i1, bool i2 = false, bool i3 = false) const {
- return field_list(d, mysql_do_nothing, i1, i2, i3);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL) const {
- return field_list(d, mysql_do_nothing, i1, i2, i3);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- vector<bool> *i) const {
- return field_list(d, mysql_do_nothing, i);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- sql_cmp_type sc) const {
- return field_list(d, mysql_do_nothing, sc);
- }
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- bool i1, bool i2 = false, bool i3 = false) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- sql_cmp_type sc) const;
- /* cus equal */
- NAME##_cus_equal_list<quote_type0> equal_list(bool i1, bool i2 = false, bool i3 = false) const {
- return equal_list(",", " = ", mysql_quote, i1, i2, i3);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL) const {
- return equal_list(",", " = ", mysql_quote, i1, i2, i3);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(vector<bool> *i) const {
- return equal_list(",", " = ", mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(sql_cmp_type sc) const {
- return equal_list(",", " = ", mysql_quote, sc);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false) const {
- return equal_list(d, " = ", mysql_quote, i1, i2, i3);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL) const {
- return equal_list(d, " = ", mysql_quote, i1, i2, i3);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d,
- vector<bool> *i) const {
- return equal_list(d, " = ", mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d,
- sql_cmp_type sc) const {
- return equal_list(d, " = ", mysql_quote, sc);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- bool i1, bool i2 = false, bool i3 = false) const {
- return equal_list(d, c, mysql_quote, i1, i2, i3);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL) const {
- return equal_list(d, c, mysql_quote, i1, i2, i3);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- vector<bool> *i) const {
- return equal_list(d, c, mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- sql_cmp_type sc) const {
- return equal_list(d, c, mysql_quote, sc);
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- bool i1, bool i2 = false, bool i3 = false) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- sql_cmp_type sc) const;
- NAME##_value_list<quote_type0> value_list() const {
- return value_list(",", mysql_quote);}
- NAME##_value_list<quote_type0> value_list(cchar *d) const {
- return value_list(d, mysql_quote);}
- template <class Manip>
- NAME##_value_list<Manip> value_list(cchar *d, Manip m) const;
- NAME##_field_list<do_nothing_type0> field_list() const {
- return field_list(",", mysql_do_nothing);}
- NAME##_field_list<do_nothing_type0> field_list(cchar *d) const {
- return field_list(d, mysql_do_nothing);}
- template <class Manip>
- NAME##_field_list<Manip> field_list(cchar *d, Manip m) const;
- NAME##_equal_list<quote_type0> equal_list(cchar *d = ",",
- cchar *c = " = ") const{
- return equal_list(d, c, mysql_quote);}
- template <class Manip>
- NAME##_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m) const;
- };
- char *##NAME##::names[] = {
- N1 ,
- N2 ,
- N3
- };
- char *##NAME##::_table = #NAME ;
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3)
- {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(3, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- }
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(3, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- if (i3 == NAME##_NULL) return;
- (*include)[i3]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(3, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(3, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- if (i3 == NAME##_NULL) return;
- (*include)[i3]=true;
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip>::NAME##_cus_equal_list
- (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3) {
- delem = d;
- comp = c;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(3, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip>::NAME##_cus_equal_list
- (const NAME *o, cchar *d, cchar *c, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3) {
- delem = d;
- comp = c;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(3, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- if (i3 == NAME##_NULL) return;
- (*include)[i3]=true;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_value_list<Manip>& obj) {
- s << obj.manip << obj.obj->##I1 << obj.delem;
- s << obj.manip << obj.obj->##I2 << obj.delem;
- s << obj.manip << obj.obj->##I3;
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_field_list<Manip>& obj) {
- s << obj.manip << obj.obj->names[0] << obj.delem;
- s << obj.manip << obj.obj->names[1] << obj.delem;
- s << obj.manip << obj.obj->names[2];
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_equal_list<Manip>& obj) {
- s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->##I1 << obj.delem;
- s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->##I2 << obj.delem;
- s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->##I3;
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_value_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.manip << obj.obj->##I1;
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->##I2;
- before = true;
- }
- if ((*obj.include)[2]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->##I3;
- }
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_field_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.manip << obj.obj->names[0];
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->names[1];
- before = true;
- }
- if ((*obj.include)[2]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->names[2];
- }
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_equal_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->##I1;
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->##I2;
- before = true;
- }
- if ((*obj.include)[2]) {
- if (before) s << obj.delem;
- s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->##I3;
- }
- return s;
- }
- template <class Manip>
- inline NAME##_value_list<Manip> NAME##::value_list(cchar *d, Manip m) const {
- return NAME##_value_list<Manip> (this, d, m);
- }
- template <class Manip>
- inline NAME##_field_list<Manip> NAME##::field_list(cchar *d, Manip m) const {
- return NAME##_field_list<Manip> (this, d, m);
- }
- template <class Manip>
- inline NAME##_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m) const {
- return NAME##_equal_list<Manip> (this, d, c, m);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip> NAME##::value_list(cchar *d, Manip m,
- bool i1, bool i2, bool i3) const {
- return NAME##_cus_value_list<Manip> (this, d, m, i1, i2, i3);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip> NAME##::field_list(cchar *d, Manip m,
- bool i1, bool i2, bool i3) const {
- return NAME##_cus_field_list<Manip> (this, d, m, i1, i2, i3);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m,
- bool i1, bool i2, bool i3) const {
- return NAME##_cus_equal_list<Manip> (this, d, c, m, i1, i2, i3);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip> NAME##::value_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3) const {
- return NAME##_cus_value_list<Manip> (this, d, m, i1, i2, i3);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip> NAME##::field_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3) const {
- return NAME##_cus_field_list<Manip> (this, d, m, i1, i2, i3);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3) const {
- return NAME##_cus_equal_list<Manip> (this, d, c, m, i1, i2, i3);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip>
- NAME##::value_list(cchar *d, Manip m, sql_cmp_type sc) const {
- sql_compare_type_def_##CMP (NAME, value, NUM);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip>
- NAME##::field_list(cchar *d, Manip m, sql_cmp_type sc) const {
- sql_compare_type_def_##CMP (NAME, field, NUM);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip>
- NAME##::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type sc) const {
- sql_compare_type_defe_##CMP (NAME, equal, NUM);
- }
- template <sql_dummy_type dummy>
- void populate_##NAME (NAME *s, const MysqlRow &row) {
- s->##I1 = row[ O1 ];
- s->##I2 = row[ O2 ];
- s->##I3 = row[ O3 ];
- }
- inline NAME##::##NAME (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- inline void NAME##::set (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- sql_COMPARE__##CMP##(NAME, I1, I2, I3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
- #define sql_create_basic_3(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3)
- sql_create_basic_c_order_3(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2)
- #define sql_create_3(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3)
- sql_create_complete_3(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2)
- #define sql_create_c_order_3(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3)
- sql_create_complete_3(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3)
- #define sql_create_c_names_3(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3)
- sql_create_complete_3(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2)
- // ---------------------------------------------------
- // End Create 3
- // ---------------------------------------------------
- // ---------------------------------------------------
- // Begin Create 4
- // ---------------------------------------------------
- #define sql_create_basic_c_order_4(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4)
- struct NAME;
- template <sql_dummy_type dummy> int sql_compare_##NAME (const NAME &, const NAME &);
- struct NAME {
- T1 I1;
- T2 I2;
- T3 I3;
- T4 I4;
- NAME () {}
- NAME (const MysqlRow &row);
- sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- };
- template <sql_dummy_type dummy>
- void populate_##NAME (NAME *s, const MysqlRow &row) {
- s->##I1 = row[ O1 ];
- s->##I2 = row[ O2 ];
- s->##I3 = row[ O3 ];
- s->##I4 = row[ O4 ];
- }
- inline NAME##::##NAME (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- sql_COMPARE__##CMP##(NAME, I1, I2, I3, I4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
- #define sql_create_complete_4(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4)
- struct NAME;
- enum NAME##_enum {
- NAME##_##I1,
- NAME##_##I2,
- NAME##_##I3,
- NAME##_##I4
- ,NAME##_NULL
- };
- template <class Manip>
- class NAME##_value_list {
- /*friend ostream& operator << <> (ostream&, const NAME##_value_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- public:
- NAME##_value_list (const NAME *o, cchar *d, Manip m)
- : obj(o), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_##field_list {
- /* friend ostream& operator << <> (ostream&, const NAME##_field_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- public:
- NAME##_field_list (const NAME *o, cchar *d, Manip m)
- : obj(o), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_equal_list {
- /* friend ostream& operator << <> (ostream&, const NAME##_equal_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- cchar *comp;
- Manip manip;
- public:
- NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m)
- : obj(o), delem(d), comp(c), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_value_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_value_list<Manip>&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- vector<bool> *include;
- bool del_vector;
- public:
- ~##NAME##_cus_value_list () {if (del_vector) delete include;}
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4);
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4);
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,vector<bool>)
- : obj(o), include(i), del_vector(false), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_field_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_field_list<Manip>&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- vector<bool> *include;
- bool del_vector;
- public:
- ~##NAME##_cus_field_list () {if (del_vector) delete include;}
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4);
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4);
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, vector<bool> *i)
- : obj(o), include(i), del_vector(false), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_equal_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_equal_list<Manip>&); */
- public:
- const NAME *obj;
- vector<bool> *include;
- bool del_vector;
- cchar *delem;
- cchar *comp;
- Manip manip;
- public:
- ~##NAME##_##cus_equal_list () {if (del_vector) delete include;}
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4);
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4);
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, vector<bool> *i)
- : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}
- };
- template <sql_dummy_type dummy> int sql_compare_##NAME (const NAME &, const NAME &);
- struct NAME {
- T1 I1;
- T2 I2;
- T3 I3;
- T4 I4;
- NAME () {}
- NAME (const MysqlRow &row);
- void set (const MysqlRow &row);
- sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- static char *names[];
- static char *_table;
- static char *& table() {return _table;}
- /* cus_data */
- NAME##_cus_value_list<quote_type0> value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {
- return value_list(",", mysql_quote, i1, i2, i3, i4);
- }
- NAME##_cus_value_list<quote_type0> value_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL) const {
- return value_list(",", mysql_quote, i1, i2, i3, i4);
- }
- NAME##_cus_value_list<quote_type0> value_list(vector<bool> *i) const {
- return value_list(",", mysql_quote, i);
- }
- NAME##_cus_value_list<quote_type0> value_list(sql_cmp_type sc) const {
- return value_list(",", mysql_quote, sc);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {
- return value_list(d, mysql_quote, i1, i2, i3, i4);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d, ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL) const {
- return value_list(d, mysql_quote, i1, i2, i3, i4);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d,
- vector<bool> *i) const {
- return value_list(d, mysql_quote, i);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d,
- sql_cmp_type sc) const {
- return value_list(d, mysql_quote, sc);
- }
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- sql_cmp_type sc) const;
- /* cus field */
- NAME##_cus_field_list<do_nothing_type0> field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {
- return field_list(",", mysql_do_nothing, i1, i2, i3, i4);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL) const {
- return field_list(",", mysql_do_nothing, i1, i2, i3, i4);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(vector<bool> *i) const {
- return field_list(",", mysql_do_nothing, i);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(sql_cmp_type sc) const
- {
- return field_list(",", mysql_do_nothing, sc);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {
- return field_list(d, mysql_do_nothing, i1, i2, i3, i4);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL) const {
- return field_list(d, mysql_do_nothing, i1, i2, i3, i4);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- vector<bool> *i) const {
- return field_list(d, mysql_do_nothing, i);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- sql_cmp_type sc) const {
- return field_list(d, mysql_do_nothing, sc);
- }
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- sql_cmp_type sc) const;
- /* cus equal */
- NAME##_cus_equal_list<quote_type0> equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {
- return equal_list(",", " = ", mysql_quote, i1, i2, i3, i4);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL) const {
- return equal_list(",", " = ", mysql_quote, i1, i2, i3, i4);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(vector<bool> *i) const {
- return equal_list(",", " = ", mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(sql_cmp_type sc) const {
- return equal_list(",", " = ", mysql_quote, sc);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {
- return equal_list(d, " = ", mysql_quote, i1, i2, i3, i4);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL) const {
- return equal_list(d, " = ", mysql_quote, i1, i2, i3, i4);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d,
- vector<bool> *i) const {
- return equal_list(d, " = ", mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d,
- sql_cmp_type sc) const {
- return equal_list(d, " = ", mysql_quote, sc);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const {
- return equal_list(d, c, mysql_quote, i1, i2, i3, i4);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL) const {
- return equal_list(d, c, mysql_quote, i1, i2, i3, i4);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- vector<bool> *i) const {
- return equal_list(d, c, mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- sql_cmp_type sc) const {
- return equal_list(d, c, mysql_quote, sc);
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- sql_cmp_type sc) const;
- NAME##_value_list<quote_type0> value_list() const {
- return value_list(",", mysql_quote);}
- NAME##_value_list<quote_type0> value_list(cchar *d) const {
- return value_list(d, mysql_quote);}
- template <class Manip>
- NAME##_value_list<Manip> value_list(cchar *d, Manip m) const;
- NAME##_field_list<do_nothing_type0> field_list() const {
- return field_list(",", mysql_do_nothing);}
- NAME##_field_list<do_nothing_type0> field_list(cchar *d) const {
- return field_list(d, mysql_do_nothing);}
- template <class Manip>
- NAME##_field_list<Manip> field_list(cchar *d, Manip m) const;
- NAME##_equal_list<quote_type0> equal_list(cchar *d = ",",
- cchar *c = " = ") const{
- return equal_list(d, c, mysql_quote);}
- template <class Manip>
- NAME##_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m) const;
- };
- char *##NAME##::names[] = {
- N1 ,
- N2 ,
- N3 ,
- N4
- };
- char *##NAME##::_table = #NAME ;
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4)
- {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(4, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- if (i4) (*include)[3]=true;
- }
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(4, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- if (i3 == NAME##_NULL) return;
- (*include)[i3]=true;
- if (i4 == NAME##_NULL) return;
- (*include)[i4]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(4, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- if (i4) (*include)[3]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(4, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- if (i3 == NAME##_NULL) return;
- (*include)[i3]=true;
- if (i4 == NAME##_NULL) return;
- (*include)[i4]=true;
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip>::NAME##_cus_equal_list
- (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4) {
- delem = d;
- comp = c;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(4, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- if (i4) (*include)[3]=true;
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip>::NAME##_cus_equal_list
- (const NAME *o, cchar *d, cchar *c, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4) {
- delem = d;
- comp = c;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(4, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- if (i3 == NAME##_NULL) return;
- (*include)[i3]=true;
- if (i4 == NAME##_NULL) return;
- (*include)[i4]=true;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_value_list<Manip>& obj) {
- s << obj.manip << obj.obj->##I1 << obj.delem;
- s << obj.manip << obj.obj->##I2 << obj.delem;
- s << obj.manip << obj.obj->##I3 << obj.delem;
- s << obj.manip << obj.obj->##I4;
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_field_list<Manip>& obj) {
- s << obj.manip << obj.obj->names[0] << obj.delem;
- s << obj.manip << obj.obj->names[1] << obj.delem;
- s << obj.manip << obj.obj->names[2] << obj.delem;
- s << obj.manip << obj.obj->names[3];
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_equal_list<Manip>& obj) {
- s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->##I1 << obj.delem;
- s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->##I2 << obj.delem;
- s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->##I3 << obj.delem;
- s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->##I4;
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_value_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.manip << obj.obj->##I1;
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->##I2;
- before = true;
- }
- if ((*obj.include)[2]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->##I3;
- before = true;
- }
- if ((*obj.include)[3]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->##I4;
- }
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_field_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.manip << obj.obj->names[0];
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->names[1];
- before = true;
- }
- if ((*obj.include)[2]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->names[2];
- before = true;
- }
- if ((*obj.include)[3]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->names[3];
- }
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_equal_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->##I1;
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->##I2;
- before = true;
- }
- if ((*obj.include)[2]) {
- if (before) s << obj.delem;
- s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->##I3;
- before = true;
- }
- if ((*obj.include)[3]) {
- if (before) s << obj.delem;
- s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->##I4;
- }
- return s;
- }
- template <class Manip>
- inline NAME##_value_list<Manip> NAME##::value_list(cchar *d, Manip m) const {
- return NAME##_value_list<Manip> (this, d, m);
- }
- template <class Manip>
- inline NAME##_field_list<Manip> NAME##::field_list(cchar *d, Manip m) const {
- return NAME##_field_list<Manip> (this, d, m);
- }
- template <class Manip>
- inline NAME##_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m) const {
- return NAME##_equal_list<Manip> (this, d, c, m);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip> NAME##::value_list(cchar *d, Manip m,
- bool i1, bool i2, bool i3, bool i4) const {
- return NAME##_cus_value_list<Manip> (this, d, m, i1, i2, i3, i4);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip> NAME##::field_list(cchar *d, Manip m,
- bool i1, bool i2, bool i3, bool i4) const {
- return NAME##_cus_field_list<Manip> (this, d, m, i1, i2, i3, i4);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m,
- bool i1, bool i2, bool i3, bool i4) const {
- return NAME##_cus_equal_list<Manip> (this, d, c, m, i1, i2, i3, i4);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip> NAME##::value_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4) const {
- return NAME##_cus_value_list<Manip> (this, d, m, i1, i2, i3, i4);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip> NAME##::field_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4) const {
- return NAME##_cus_field_list<Manip> (this, d, m, i1, i2, i3, i4);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4) const {
- return NAME##_cus_equal_list<Manip> (this, d, c, m, i1, i2, i3, i4);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip>
- NAME##::value_list(cchar *d, Manip m, sql_cmp_type sc) const {
- sql_compare_type_def_##CMP (NAME, value, NUM);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip>
- NAME##::field_list(cchar *d, Manip m, sql_cmp_type sc) const {
- sql_compare_type_def_##CMP (NAME, field, NUM);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip>
- NAME##::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type sc) const {
- sql_compare_type_defe_##CMP (NAME, equal, NUM);
- }
- template <sql_dummy_type dummy>
- void populate_##NAME (NAME *s, const MysqlRow &row) {
- s->##I1 = row[ O1 ];
- s->##I2 = row[ O2 ];
- s->##I3 = row[ O3 ];
- s->##I4 = row[ O4 ];
- }
- inline NAME##::##NAME (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- inline void NAME##::set (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- sql_COMPARE__##CMP##(NAME, I1, I2, I3, I4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
- #define sql_create_basic_4(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4)
- sql_create_basic_c_order_4(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3)
- #define sql_create_4(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4)
- sql_create_complete_4(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3)
- #define sql_create_c_order_4(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4)
- sql_create_complete_4(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4)
- #define sql_create_c_names_4(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4)
- sql_create_complete_4(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3)
- // ---------------------------------------------------
- // End Create 4
- // ---------------------------------------------------
- // ---------------------------------------------------
- // Begin Create 5
- // ---------------------------------------------------
- #define sql_create_basic_c_order_5(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5)
- struct NAME;
- template <sql_dummy_type dummy> int sql_compare_##NAME (const NAME &, const NAME &);
- struct NAME {
- T1 I1;
- T2 I2;
- T3 I3;
- T4 I4;
- T5 I5;
- NAME () {}
- NAME (const MysqlRow &row);
- sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- };
- template <sql_dummy_type dummy>
- void populate_##NAME (NAME *s, const MysqlRow &row) {
- s->##I1 = row[ O1 ];
- s->##I2 = row[ O2 ];
- s->##I3 = row[ O3 ];
- s->##I4 = row[ O4 ];
- s->##I5 = row[ O5 ];
- }
- inline NAME##::##NAME (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- sql_COMPARE__##CMP##(NAME, I1, I2, I3, I4, I5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
- #define sql_create_complete_5(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5)
- struct NAME;
- enum NAME##_enum {
- NAME##_##I1,
- NAME##_##I2,
- NAME##_##I3,
- NAME##_##I4,
- NAME##_##I5
- ,NAME##_NULL
- };
- template <class Manip>
- class NAME##_value_list {
- /*friend ostream& operator << <> (ostream&, const NAME##_value_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- public:
- NAME##_value_list (const NAME *o, cchar *d, Manip m)
- : obj(o), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_##field_list {
- /* friend ostream& operator << <> (ostream&, const NAME##_field_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- public:
- NAME##_field_list (const NAME *o, cchar *d, Manip m)
- : obj(o), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_equal_list {
- /* friend ostream& operator << <> (ostream&, const NAME##_equal_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- cchar *comp;
- Manip manip;
- public:
- NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m)
- : obj(o), delem(d), comp(c), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_value_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_value_list<Manip>&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- vector<bool> *include;
- bool del_vector;
- public:
- ~##NAME##_cus_value_list () {if (del_vector) delete include;}
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5);
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5);
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,vector<bool>)
- : obj(o), include(i), del_vector(false), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_field_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_field_list<Manip>&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- vector<bool> *include;
- bool del_vector;
- public:
- ~##NAME##_cus_field_list () {if (del_vector) delete include;}
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5);
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5);
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, vector<bool> *i)
- : obj(o), include(i), del_vector(false), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_equal_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_equal_list<Manip>&); */
- public:
- const NAME *obj;
- vector<bool> *include;
- bool del_vector;
- cchar *delem;
- cchar *comp;
- Manip manip;
- public:
- ~##NAME##_##cus_equal_list () {if (del_vector) delete include;}
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5);
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5);
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, vector<bool> *i)
- : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}
- };
- template <sql_dummy_type dummy> int sql_compare_##NAME (const NAME &, const NAME &);
- struct NAME {
- T1 I1;
- T2 I2;
- T3 I3;
- T4 I4;
- T5 I5;
- NAME () {}
- NAME (const MysqlRow &row);
- void set (const MysqlRow &row);
- sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- static char *names[];
- static char *_table;
- static char *& table() {return _table;}
- /* cus_data */
- NAME##_cus_value_list<quote_type0> value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {
- return value_list(",", mysql_quote, i1, i2, i3, i4, i5);
- }
- NAME##_cus_value_list<quote_type0> value_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL) const {
- return value_list(",", mysql_quote, i1, i2, i3, i4, i5);
- }
- NAME##_cus_value_list<quote_type0> value_list(vector<bool> *i) const {
- return value_list(",", mysql_quote, i);
- }
- NAME##_cus_value_list<quote_type0> value_list(sql_cmp_type sc) const {
- return value_list(",", mysql_quote, sc);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {
- return value_list(d, mysql_quote, i1, i2, i3, i4, i5);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d, ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL) const {
- return value_list(d, mysql_quote, i1, i2, i3, i4, i5);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d,
- vector<bool> *i) const {
- return value_list(d, mysql_quote, i);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d,
- sql_cmp_type sc) const {
- return value_list(d, mysql_quote, sc);
- }
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- sql_cmp_type sc) const;
- /* cus field */
- NAME##_cus_field_list<do_nothing_type0> field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {
- return field_list(",", mysql_do_nothing, i1, i2, i3, i4, i5);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL) const {
- return field_list(",", mysql_do_nothing, i1, i2, i3, i4, i5);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(vector<bool> *i) const {
- return field_list(",", mysql_do_nothing, i);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(sql_cmp_type sc) const
- {
- return field_list(",", mysql_do_nothing, sc);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {
- return field_list(d, mysql_do_nothing, i1, i2, i3, i4, i5);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL) const {
- return field_list(d, mysql_do_nothing, i1, i2, i3, i4, i5);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- vector<bool> *i) const {
- return field_list(d, mysql_do_nothing, i);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- sql_cmp_type sc) const {
- return field_list(d, mysql_do_nothing, sc);
- }
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- sql_cmp_type sc) const;
- /* cus equal */
- NAME##_cus_equal_list<quote_type0> equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {
- return equal_list(",", " = ", mysql_quote, i1, i2, i3, i4, i5);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL) const {
- return equal_list(",", " = ", mysql_quote, i1, i2, i3, i4, i5);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(vector<bool> *i) const {
- return equal_list(",", " = ", mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(sql_cmp_type sc) const {
- return equal_list(",", " = ", mysql_quote, sc);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {
- return equal_list(d, " = ", mysql_quote, i1, i2, i3, i4, i5);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL) const {
- return equal_list(d, " = ", mysql_quote, i1, i2, i3, i4, i5);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d,
- vector<bool> *i) const {
- return equal_list(d, " = ", mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d,
- sql_cmp_type sc) const {
- return equal_list(d, " = ", mysql_quote, sc);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const {
- return equal_list(d, c, mysql_quote, i1, i2, i3, i4, i5);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL) const {
- return equal_list(d, c, mysql_quote, i1, i2, i3, i4, i5);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- vector<bool> *i) const {
- return equal_list(d, c, mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- sql_cmp_type sc) const {
- return equal_list(d, c, mysql_quote, sc);
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- sql_cmp_type sc) const;
- NAME##_value_list<quote_type0> value_list() const {
- return value_list(",", mysql_quote);}
- NAME##_value_list<quote_type0> value_list(cchar *d) const {
- return value_list(d, mysql_quote);}
- template <class Manip>
- NAME##_value_list<Manip> value_list(cchar *d, Manip m) const;
- NAME##_field_list<do_nothing_type0> field_list() const {
- return field_list(",", mysql_do_nothing);}
- NAME##_field_list<do_nothing_type0> field_list(cchar *d) const {
- return field_list(d, mysql_do_nothing);}
- template <class Manip>
- NAME##_field_list<Manip> field_list(cchar *d, Manip m) const;
- NAME##_equal_list<quote_type0> equal_list(cchar *d = ",",
- cchar *c = " = ") const{
- return equal_list(d, c, mysql_quote);}
- template <class Manip>
- NAME##_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m) const;
- };
- char *##NAME##::names[] = {
- N1 ,
- N2 ,
- N3 ,
- N4 ,
- N5
- };
- char *##NAME##::_table = #NAME ;
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5)
- {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(5, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- if (i4) (*include)[3]=true;
- if (i5) (*include)[4]=true;
- }
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(5, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- if (i3 == NAME##_NULL) return;
- (*include)[i3]=true;
- if (i4 == NAME##_NULL) return;
- (*include)[i4]=true;
- if (i5 == NAME##_NULL) return;
- (*include)[i5]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(5, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- if (i4) (*include)[3]=true;
- if (i5) (*include)[4]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(5, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- if (i3 == NAME##_NULL) return;
- (*include)[i3]=true;
- if (i4 == NAME##_NULL) return;
- (*include)[i4]=true;
- if (i5 == NAME##_NULL) return;
- (*include)[i5]=true;
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip>::NAME##_cus_equal_list
- (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5) {
- delem = d;
- comp = c;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(5, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- if (i4) (*include)[3]=true;
- if (i5) (*include)[4]=true;
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip>::NAME##_cus_equal_list
- (const NAME *o, cchar *d, cchar *c, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5) {
- delem = d;
- comp = c;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(5, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- if (i3 == NAME##_NULL) return;
- (*include)[i3]=true;
- if (i4 == NAME##_NULL) return;
- (*include)[i4]=true;
- if (i5 == NAME##_NULL) return;
- (*include)[i5]=true;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_value_list<Manip>& obj) {
- s << obj.manip << obj.obj->##I1 << obj.delem;
- s << obj.manip << obj.obj->##I2 << obj.delem;
- s << obj.manip << obj.obj->##I3 << obj.delem;
- s << obj.manip << obj.obj->##I4 << obj.delem;
- s << obj.manip << obj.obj->##I5;
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_field_list<Manip>& obj) {
- s << obj.manip << obj.obj->names[0] << obj.delem;
- s << obj.manip << obj.obj->names[1] << obj.delem;
- s << obj.manip << obj.obj->names[2] << obj.delem;
- s << obj.manip << obj.obj->names[3] << obj.delem;
- s << obj.manip << obj.obj->names[4];
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_equal_list<Manip>& obj) {
- s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->##I1 << obj.delem;
- s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->##I2 << obj.delem;
- s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->##I3 << obj.delem;
- s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->##I4 << obj.delem;
- s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->##I5;
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_value_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.manip << obj.obj->##I1;
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->##I2;
- before = true;
- }
- if ((*obj.include)[2]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->##I3;
- before = true;
- }
- if ((*obj.include)[3]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->##I4;
- before = true;
- }
- if ((*obj.include)[4]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->##I5;
- }
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_field_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.manip << obj.obj->names[0];
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->names[1];
- before = true;
- }
- if ((*obj.include)[2]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->names[2];
- before = true;
- }
- if ((*obj.include)[3]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->names[3];
- before = true;
- }
- if ((*obj.include)[4]) {
- if (before) s << obj.delem;
- s << obj.manip << obj.obj->names[4];
- }
- return s;
- }
- template <class Manip>
- ostream& operator << (ostream& s, const NAME##_cus_equal_list<Manip>& obj) {
- bool before = false;
- if ((*obj.include)[0]) {
- s << obj.obj->names[0] << obj.comp << obj.manip << obj.obj->##I1;
- before = true;
- }
- if ((*obj.include)[1]) {
- if (before) s << obj.delem;
- s << obj.obj->names[1] << obj.comp << obj.manip << obj.obj->##I2;
- before = true;
- }
- if ((*obj.include)[2]) {
- if (before) s << obj.delem;
- s << obj.obj->names[2] << obj.comp << obj.manip << obj.obj->##I3;
- before = true;
- }
- if ((*obj.include)[3]) {
- if (before) s << obj.delem;
- s << obj.obj->names[3] << obj.comp << obj.manip << obj.obj->##I4;
- before = true;
- }
- if ((*obj.include)[4]) {
- if (before) s << obj.delem;
- s << obj.obj->names[4] << obj.comp << obj.manip << obj.obj->##I5;
- }
- return s;
- }
- template <class Manip>
- inline NAME##_value_list<Manip> NAME##::value_list(cchar *d, Manip m) const {
- return NAME##_value_list<Manip> (this, d, m);
- }
- template <class Manip>
- inline NAME##_field_list<Manip> NAME##::field_list(cchar *d, Manip m) const {
- return NAME##_field_list<Manip> (this, d, m);
- }
- template <class Manip>
- inline NAME##_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m) const {
- return NAME##_equal_list<Manip> (this, d, c, m);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip> NAME##::value_list(cchar *d, Manip m,
- bool i1, bool i2, bool i3, bool i4, bool i5) const {
- return NAME##_cus_value_list<Manip> (this, d, m, i1, i2, i3, i4, i5);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip> NAME##::field_list(cchar *d, Manip m,
- bool i1, bool i2, bool i3, bool i4, bool i5) const {
- return NAME##_cus_field_list<Manip> (this, d, m, i1, i2, i3, i4, i5);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m,
- bool i1, bool i2, bool i3, bool i4, bool i5) const {
- return NAME##_cus_equal_list<Manip> (this, d, c, m, i1, i2, i3, i4, i5);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip> NAME##::value_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5) const {
- return NAME##_cus_value_list<Manip> (this, d, m, i1, i2, i3, i4, i5);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip> NAME##::field_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5) const {
- return NAME##_cus_field_list<Manip> (this, d, m, i1, i2, i3, i4, i5);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip> NAME##::equal_list(cchar *d, cchar *c, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5) const {
- return NAME##_cus_equal_list<Manip> (this, d, c, m, i1, i2, i3, i4, i5);
- }
- template <class Manip>
- inline NAME##_cus_value_list<Manip>
- NAME##::value_list(cchar *d, Manip m, sql_cmp_type sc) const {
- sql_compare_type_def_##CMP (NAME, value, NUM);
- }
- template <class Manip>
- inline NAME##_cus_field_list<Manip>
- NAME##::field_list(cchar *d, Manip m, sql_cmp_type sc) const {
- sql_compare_type_def_##CMP (NAME, field, NUM);
- }
- template <class Manip>
- inline NAME##_cus_equal_list<Manip>
- NAME##::equal_list(cchar *d, cchar *c, Manip m, sql_cmp_type sc) const {
- sql_compare_type_defe_##CMP (NAME, equal, NUM);
- }
- template <sql_dummy_type dummy>
- void populate_##NAME (NAME *s, const MysqlRow &row) {
- s->##I1 = row[ O1 ];
- s->##I2 = row[ O2 ];
- s->##I3 = row[ O3 ];
- s->##I4 = row[ O4 ];
- s->##I5 = row[ O5 ];
- }
- inline NAME##::##NAME (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- inline void NAME##::set (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- sql_COMPARE__##CMP##(NAME, I1, I2, I3, I4, I5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
- #define sql_create_basic_5(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5)
- sql_create_basic_c_order_5(NAME, CMP, CONTR, T1, I1, 0, T2, I2, 1, T3, I3, 2, T4, I4, 3, T5, I5, 4)
- #define sql_create_5(NAME, CMP, CONTR, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5)
- sql_create_complete_5(NAME, CMP, CONTR, T1, I1, #I1, 0, T2, I2, #I2, 1, T3, I3, #I3, 2, T4, I4, #I4, 3, T5, I5, #I5, 4)
- #define sql_create_c_order_5(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5)
- sql_create_complete_5(NAME, CMP, CONTR, T1, I1, #I1, O1, T2, I2, #I2, O2, T3, I3, #I3, O3, T4, I4, #I4, O4, T5, I5, #I5, O5)
- #define sql_create_c_names_5(NAME, CMP, CONTR, T1, I1, N1, T2, I2, N2, T3, I3, N3, T4, I4, N4, T5, I5, N5)
- sql_create_complete_5(NAME, CMP, CONTR, T1, I1, N1, 0, T2, I2, N2, 1, T3, I3, N3, 2, T4, I4, N4, 3, T5, I5, N5, 4)
- // ---------------------------------------------------
- // End Create 5
- // ---------------------------------------------------
- // ---------------------------------------------------
- // Begin Create 6
- // ---------------------------------------------------
- #define sql_create_basic_c_order_6(NAME, CMP, CONTR, T1, I1, O1, T2, I2, O2, T3, I3, O3, T4, I4, O4, T5, I5, O5, T6, I6, O6)
- struct NAME;
- template <sql_dummy_type dummy> int sql_compare_##NAME (const NAME &, const NAME &);
- struct NAME {
- T1 I1;
- T2 I2;
- T3 I3;
- T4 I4;
- T5 I5;
- T6 I6;
- NAME () {}
- NAME (const MysqlRow &row);
- sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- };
- template <sql_dummy_type dummy>
- void populate_##NAME (NAME *s, const MysqlRow &row) {
- s->##I1 = row[ O1 ];
- s->##I2 = row[ O2 ];
- s->##I3 = row[ O3 ];
- s->##I4 = row[ O4 ];
- s->##I5 = row[ O5 ];
- s->##I6 = row[ O6 ];
- }
- inline NAME##::##NAME (const MysqlRow &row)
- {populate_##NAME##<sql_dummy>(this, row);}
- sql_COMPARE__##CMP##(NAME, I1, I2, I3, I4, I5, I6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 )
- #define sql_create_complete_6(NAME, CMP, CONTR, T1, I1, N1, O1, T2, I2, N2, O2, T3, I3, N3, O3, T4, I4, N4, O4, T5, I5, N5, O5, T6, I6, N6, O6)
- struct NAME;
- enum NAME##_enum {
- NAME##_##I1,
- NAME##_##I2,
- NAME##_##I3,
- NAME##_##I4,
- NAME##_##I5,
- NAME##_##I6
- ,NAME##_NULL
- };
- template <class Manip>
- class NAME##_value_list {
- /*friend ostream& operator << <> (ostream&, const NAME##_value_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- public:
- NAME##_value_list (const NAME *o, cchar *d, Manip m)
- : obj(o), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_##field_list {
- /* friend ostream& operator << <> (ostream&, const NAME##_field_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- public:
- NAME##_field_list (const NAME *o, cchar *d, Manip m)
- : obj(o), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_equal_list {
- /* friend ostream& operator << <> (ostream&, const NAME##_equal_list&); */
- public:
- const NAME *obj;
- cchar *delem;
- cchar *comp;
- Manip manip;
- public:
- NAME##_equal_list (const NAME *o, cchar *d, cchar *c, Manip m)
- : obj(o), delem(d), comp(c), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_value_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_value_list<Manip>&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- vector<bool> *include;
- bool del_vector;
- public:
- ~##NAME##_cus_value_list () {if (del_vector) delete include;}
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6);
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5, ##NAME##_enum i6);
- NAME##_cus_value_list (const NAME *o, cchar *d, Manip m ,vector<bool>)
- : obj(o), include(i), del_vector(false), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_field_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_field_list<Manip>&); */
- public:
- const NAME *obj;
- cchar *delem;
- Manip manip;
- vector<bool> *include;
- bool del_vector;
- public:
- ~##NAME##_cus_field_list () {if (del_vector) delete include;}
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6);
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5, ##NAME##_enum i6);
- NAME##_cus_field_list (const NAME *o, cchar *d, Manip m, vector<bool> *i)
- : obj(o), include(i), del_vector(false), delem(d), manip(m) {}
- };
- template <class Manip>
- class NAME##_cus_equal_list {
- /* friend ostream& operator << <> (ostream&,
- const NAME##_cus_equal_list<Manip>&); */
- public:
- const NAME *obj;
- vector<bool> *include;
- bool del_vector;
- cchar *delem;
- cchar *comp;
- Manip manip;
- public:
- ~##NAME##_##cus_equal_list () {if (del_vector) delete include;}
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6);
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5, ##NAME##_enum i6);
- NAME##_##cus_equal_list (const NAME *o, cchar *d, cchar *c, Manip m, vector<bool> *i)
- : obj(o), include(i), del_vector(false), delem(d), comp(c), manip(m) {}
- };
- template <sql_dummy_type dummy> int sql_compare_##NAME (const NAME &, const NAME &);
- struct NAME {
- T1 I1;
- T2 I2;
- T3 I3;
- T4 I4;
- T5 I5;
- T6 I6;
- NAME () {}
- NAME (const MysqlRow &row);
- void set (const MysqlRow &row);
- sql_compare_define_##CMP(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- sql_construct_define_##CONTR(NAME, T1, I1, T2, I2, T3, I3, T4, I4, T5, I5, T6, I6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- static char *names[];
- static char *_table;
- static char *& table() {return _table;}
- /* cus_data */
- NAME##_cus_value_list<quote_type0> value_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {
- return value_list(",", mysql_quote, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_value_list<quote_type0> value_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL, ##NAME##_enum i6 = ##NAME##_NULL) const {
- return value_list(",", mysql_quote, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_value_list<quote_type0> value_list(vector<bool> *i) const {
- return value_list(",", mysql_quote, i);
- }
- NAME##_cus_value_list<quote_type0> value_list(sql_cmp_type sc) const {
- return value_list(",", mysql_quote, sc);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {
- return value_list(d, mysql_quote, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d, ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL, ##NAME##_enum i6 = ##NAME##_NULL) const {
- return value_list(d, mysql_quote, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d,
- vector<bool> *i) const {
- return value_list(d, mysql_quote, i);
- }
- NAME##_cus_value_list<quote_type0> value_list(cchar *d,
- sql_cmp_type sc) const {
- return value_list(d, mysql_quote, sc);
- }
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL, ##NAME##_enum i6 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_value_list<Manip> value_list(cchar *d, Manip m,
- sql_cmp_type sc) const;
- /* cus field */
- NAME##_cus_field_list<do_nothing_type0> field_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {
- return field_list(",", mysql_do_nothing, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL, ##NAME##_enum i6 = ##NAME##_NULL) const {
- return field_list(",", mysql_do_nothing, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(vector<bool> *i) const {
- return field_list(",", mysql_do_nothing, i);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(sql_cmp_type sc) const
- {
- return field_list(",", mysql_do_nothing, sc);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {
- return field_list(d, mysql_do_nothing, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL, ##NAME##_enum i6 = ##NAME##_NULL) const {
- return field_list(d, mysql_do_nothing, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- vector<bool> *i) const {
- return field_list(d, mysql_do_nothing, i);
- }
- NAME##_cus_field_list<do_nothing_type0> field_list(cchar *d,
- sql_cmp_type sc) const {
- return field_list(d, mysql_do_nothing, sc);
- }
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL, ##NAME##_enum i6 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_field_list<Manip> field_list(cchar *d, Manip m,
- sql_cmp_type sc) const;
- /* cus equal */
- NAME##_cus_equal_list<quote_type0> equal_list(bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {
- return equal_list(",", " = ", mysql_quote, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL, ##NAME##_enum i6 = ##NAME##_NULL) const {
- return equal_list(",", " = ", mysql_quote, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(vector<bool> *i) const {
- return equal_list(",", " = ", mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(sql_cmp_type sc) const {
- return equal_list(",", " = ", mysql_quote, sc);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {
- return equal_list(d, " = ", mysql_quote, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL, ##NAME##_enum i6 = ##NAME##_NULL) const {
- return equal_list(d, " = ", mysql_quote, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d,
- vector<bool> *i) const {
- return equal_list(d, " = ", mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d,
- sql_cmp_type sc) const {
- return equal_list(d, " = ", mysql_quote, sc);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const {
- return equal_list(d, c, mysql_quote, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL, ##NAME##_enum i6 = ##NAME##_NULL) const {
- return equal_list(d, c, mysql_quote, i1, i2, i3, i4, i5, i6);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- vector<bool> *i) const {
- return equal_list(d, c, mysql_quote, i);
- }
- NAME##_cus_equal_list<quote_type0> equal_list(cchar *d, cchar *c,
- sql_cmp_type sc) const {
- return equal_list(d, c, mysql_quote, sc);
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- bool i1, bool i2 = false, bool i3 = false, bool i4 = false, bool i5 = false, bool i6 = false) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- ##NAME##_enum i1, ##NAME##_enum i2 = ##NAME##_NULL, ##NAME##_enum i3 = ##NAME##_NULL, ##NAME##_enum i4 = ##NAME##_NULL, ##NAME##_enum i5 = ##NAME##_NULL, ##NAME##_enum i6 = ##NAME##_NULL) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- vector<bool> *i) const;
- template <class Manip>
- NAME##_cus_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m,
- sql_cmp_type sc) const;
- NAME##_value_list<quote_type0> value_list() const {
- return value_list(",", mysql_quote);}
- NAME##_value_list<quote_type0> value_list(cchar *d) const {
- return value_list(d, mysql_quote);}
- template <class Manip>
- NAME##_value_list<Manip> value_list(cchar *d, Manip m) const;
- NAME##_field_list<do_nothing_type0> field_list() const {
- return field_list(",", mysql_do_nothing);}
- NAME##_field_list<do_nothing_type0> field_list(cchar *d) const {
- return field_list(d, mysql_do_nothing);}
- template <class Manip>
- NAME##_field_list<Manip> field_list(cchar *d, Manip m) const;
- NAME##_equal_list<quote_type0> equal_list(cchar *d = ",",
- cchar *c = " = ") const{
- return equal_list(d, c, mysql_quote);}
- template <class Manip>
- NAME##_equal_list<Manip> equal_list(cchar *d, cchar *c, Manip m) const;
- };
- char *##NAME##::names[] = {
- N1 ,
- N2 ,
- N3 ,
- N4 ,
- N5 ,
- N6
- };
- char *##NAME##::_table = #NAME ;
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6)
- {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(6, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- if (i4) (*include)[3]=true;
- if (i5) (*include)[4]=true;
- if (i6) (*include)[5]=true;
- }
- template <class Manip>
- NAME##_cus_value_list<Manip>::NAME##_cus_value_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5, ##NAME##_enum i6) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(6, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- if (i3 == NAME##_NULL) return;
- (*include)[i3]=true;
- if (i4 == NAME##_NULL) return;
- (*include)[i4]=true;
- if (i5 == NAME##_NULL) return;
- (*include)[i5]=true;
- if (i6 == NAME##_NULL) return;
- (*include)[i6]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(6, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- if (i4) (*include)[3]=true;
- if (i5) (*include)[4]=true;
- if (i6) (*include)[5]=true;
- }
- template <class Manip>
- NAME##_cus_field_list<Manip>::NAME##_cus_field_list
- (const NAME *o, cchar *d, Manip m, ##NAME##_enum i1, ##NAME##_enum i2, ##NAME##_enum i3, ##NAME##_enum i4, ##NAME##_enum i5, ##NAME##_enum i6) {
- delem = d;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(6, false);
- if (i1 == NAME##_NULL) return;
- (*include)[i1]=true;
- if (i2 == NAME##_NULL) return;
- (*include)[i2]=true;
- if (i3 == NAME##_NULL) return;
- (*include)[i3]=true;
- if (i4 == NAME##_NULL) return;
- (*include)[i4]=true;
- if (i5 == NAME##_NULL) return;
- (*include)[i5]=true;
- if (i6 == NAME##_NULL) return;
- (*include)[i6]=true;
- }
- template <class Manip>
- NAME##_cus_equal_list<Manip>::NAME##_cus_equal_list
- (const NAME *o, cchar *d, cchar *c, Manip m, bool i1, bool i2, bool i3, bool i4, bool i5, bool i6) {
- delem = d;
- comp = c;
- manip = m;
- del_vector = true;
- obj = o;
- include = new vector<bool>(6, false);
- if (i1) (*include)[0]=true;
- if (i2) (*include)[1]=true;
- if (i3) (*include)[2]=true;
- if (i4) (*include)[3]=true;
- if (i5) (*include)[4]=true;
- if (i6) (*include)[5]=true;