From 3f37eff838e00274e20acc89f58fc36fb3531e94 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 21 Jun 2011 20:13:06 +0200 Subject: Add hooks for generating extra code in object traits --- odb/relational/header.hxx | 15 +++++++++++++++ odb/relational/inline.hxx | 7 +++++++ odb/relational/source.hxx | 7 +++++++ 3 files changed, 29 insertions(+) diff --git a/odb/relational/header.hxx b/odb/relational/header.hxx index 3ecc8d8..16c7855 100644 --- a/odb/relational/header.hxx +++ b/odb/relational/header.hxx @@ -728,6 +728,16 @@ namespace relational } virtual void + object_public_extra_pre (type&) + { + } + + virtual void + object_public_extra_post (type&) + { + } + + virtual void traverse_object (type& c) { bool abst (abstract (c)); @@ -745,6 +755,8 @@ namespace relational << "{" << "public:" << endl; + object_public_extra_pre (c); + // object_type & pointer_type // os << "typedef " << type << " object_type;" @@ -869,6 +881,7 @@ namespace relational // if (abst) { + object_public_extra_post (c); os << "};"; return; } @@ -974,6 +987,8 @@ namespace relational << endl; } + object_public_extra_post (c); + // Implementation details. // os << "public:" << endl; diff --git a/odb/relational/inline.hxx b/odb/relational/inline.hxx index 73e0112..856965c 100644 --- a/odb/relational/inline.hxx +++ b/odb/relational/inline.hxx @@ -30,6 +30,11 @@ namespace relational } virtual void + object_extra (type&) + { + } + + virtual void traverse_object (type& c) { bool abst (abstract (c)); @@ -43,6 +48,8 @@ namespace relational << "//" << endl << endl; + object_extra (c); + if (id != 0) { // id (object_type) diff --git a/odb/relational/source.hxx b/odb/relational/source.hxx index b65bf4d..2cf11c2 100644 --- a/odb/relational/source.hxx +++ b/odb/relational/source.hxx @@ -1821,6 +1821,11 @@ namespace relational } virtual void + object_extra (type&) + { + } + + virtual void traverse_object (type& c) { bool abst (abstract (c)); @@ -1838,6 +1843,8 @@ namespace relational << "//" << endl << endl; + object_extra (c); + // // Query. // -- cgit v1.1