diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-07-23 14:42:52 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-07-23 14:42:52 +0200 |
commit | 30d797ffff4a8e2492500aea2135567f91b15aa0 (patch) | |
tree | 53fa570844ab3876026ec6621b40c74547e1db24 /odb/mysql/source.cxx | |
parent | cea6fb57ac8c9a893c0f404fef6c1469f0b6222b (diff) |
Add generation of the image class definition
Diffstat (limited to 'odb/mysql/source.cxx')
-rw-r--r-- | odb/mysql/source.cxx | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/odb/mysql/source.cxx b/odb/mysql/source.cxx index 0f117ec..5dfcf2e 100644 --- a/odb/mysql/source.cxx +++ b/odb/mysql/source.cxx @@ -6,76 +6,76 @@ #include <odb/mysql/common.hxx> #include <odb/mysql/source.hxx> -namespace +namespace mysql { - struct class_: traversal::class_, context + namespace { - class_ (context& c) - : context (c) + struct class_: traversal::class_, context { - } + class_ (context& c) + : context (c) + { + } - virtual void - traverse (type& c) - { - if (c.file () != unit.file ()) - return; - - if (!c.count ("object")) - return; - - string const& type (c.fq_name ()); - string traits ("access::object_traits< " + type + " >"); - - id_member t (*this); - t.traverse (c); - semantics::data_member& id (*t.member ()); - - os << "// " << c.name () << endl - << "//" << endl - << endl; - - // persist () - // - os << "void " << traits << "::" << endl - << "persist (database&, object_type& obj)" - << "{" - << "}"; - - // store () - // - os << "void " << traits << "::" << endl - << "store (database&, object_type& obj)" - << "{" - << "}"; - - // erase () - // - os << "void " << traits << "::" << endl - << "erase (database&, const id_type& id)" - << "{" - << "}"; - - // find () - // - os << traits << "::pointer_type" << endl - << traits << "::" << endl - << "find (database&, const id_type& id)" - << "{" - << "return 0;" - << "}"; - - os << "bool " << traits << "::" << endl - << "find (database&, const id_type& id, object_type& obj)" - << "{" - << "return false;" - << "}"; - } - }; -} + virtual void + traverse (type& c) + { + if (c.file () != unit.file ()) + return; + + if (!c.count ("object")) + return; + + string const& type (c.fq_name ()); + string traits ("access::object_traits< " + type + " >"); + + id_member t (*this); + t.traverse (c); + semantics::data_member& id (*t.member ()); + + os << "// " << c.name () << endl + << "//" << endl + << endl; + + // persist () + // + os << "void " << traits << "::" << endl + << "persist (database&, object_type& obj)" + << "{" + << "}"; + + // store () + // + os << "void " << traits << "::" << endl + << "store (database&, object_type& obj)" + << "{" + << "}"; + + // erase () + // + os << "void " << traits << "::" << endl + << "erase (database&, const id_type& id)" + << "{" + << "}"; + + // find () + // + os << traits << "::pointer_type" << endl + << traits << "::" << endl + << "find (database&, const id_type& id)" + << "{" + << "return 0;" + << "}"; + + os << "bool " << traits << "::" << endl + << "find (database&, const id_type& id, object_type& obj)" + << "{" + << "return false;" + << "}"; + } + }; + } -namespace mysql -{ void generate_source (context& ctx) { |