From 425fb7fdbe9cdb48ad84dda45c53d92dc23c3ad4 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 24 Jun 2015 20:20:50 +0200 Subject: Cleanup of member access --- odb/header.cxx | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'odb/header.cxx') diff --git a/odb/header.cxx b/odb/header.cxx index f889ce9..0a01311 100644 --- a/odb/header.cxx +++ b/odb/header.cxx @@ -64,7 +64,7 @@ traverse_object (type& c) bool auto_id (id && auto_ (*id)); bool base_id (id && &id->scope () != &c); // Comes from base. - data_member* optimistic (context::optimistic (c)); + data_member* opt (context::optimistic (c)); type* poly_root (polymorphic (c)); bool poly (poly_root != 0); @@ -163,7 +163,7 @@ traverse_object (type& c) os << "typedef object_traits< " << type << " >::id_type id_type;"; - if (optimistic != 0) + if (opt != 0) os << "typedef object_traits< " << type << " >::version_type " << "version_type;"; @@ -183,10 +183,10 @@ traverse_object (type& c) os << "typedef " << t.fq_name (hint) << " id_type;"; } - if (optimistic != 0) + if (opt != 0) { semantics::names* hint; - semantics::type& t (utype (*optimistic, hint)); + semantics::type& t (utype (*opt, hint)); os << "typedef " << t.fq_name (hint) << " version_type;"; } @@ -211,7 +211,7 @@ traverse_object (type& c) os << "static const bool abstract = " << abst << ";" << endl; - // id () + // id() // if (id != 0 || !reuse_abst) { @@ -225,6 +225,15 @@ traverse_object (type& c) << endl; } + // version() + // + if (opt != 0) + { + os << "static version_type" << endl + << "version (const object_type&);" + << endl; + } + // Query. // if (options.generate_query ()) -- cgit v1.1