From 1b2da148946713f57dfe883c25953c488889e5a9 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 9 Nov 2010 14:52:34 +0200 Subject: Add support for standard and custom ODB compilation prologues and epilogues --- odb/mysql/header.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'odb/mysql') diff --git a/odb/mysql/header.cxx b/odb/mysql/header.cxx index b4781f9..195263c 100644 --- a/odb/mysql/header.cxx +++ b/odb/mysql/header.cxx @@ -320,6 +320,7 @@ namespace mysql << "{"; // container_type + // container_traits // index_type // key_type // value_type @@ -327,18 +328,20 @@ namespace mysql os << "typedef " << t.fq_name (m.belongs ().hint ()) << " container_type;"; + os << "typedef odb::access::container_traits< container_type > " << + "container_traits;"; switch (ck) { case ck_ordered: { - os << "typedef " << container_fq_it (m) << " index_type;"; + os << "typedef container_traits::index_type index_type;"; break; } case ck_map: case ck_multimap: { - os << "typedef " << container_fq_kt (m) << " key_type;"; + os << "typedef container_traits::key_type key_type;"; } case ck_set: case ck_multiset: @@ -347,12 +350,9 @@ namespace mysql } } - os << "typedef " << container_fq_vt (m) << " value_type;" + os << "typedef container_traits::value_type value_type;" << endl; - os << "typedef odb::access::container_traits< container_type > " << - "container_traits;"; - // functions_type // switch (ck) @@ -928,8 +928,10 @@ namespace mysql << endl; if (ctx.options.generate_query ()) - ctx.os << "#include " << endl - << endl; + ctx.os << "#include " << endl; + + ctx.os << "#include " << endl + << endl; ctx.os << "#include " << endl << "#include " << endl -- cgit v1.1