From f4a26457ea30754e57e6adc82dd18c19572d3937 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 Feb 2015 17:23:53 +0200 Subject: Implement object loading views See section 10.2 in the manual for details. --- odb/view-image.hxx | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 odb/view-image.hxx diff --git a/odb/view-image.hxx b/odb/view-image.hxx new file mode 100644 index 0000000..565a58b --- /dev/null +++ b/odb/view-image.hxx @@ -0,0 +1,37 @@ +// file : odb/view-image.hxx +// copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#ifndef ODB_VIEW_IMAGE_HXX +#define ODB_VIEW_IMAGE_HXX + +#include + +#include +#include + +namespace odb +{ + // Helper to create a complete image chain for a polymorphic + // object hierarchy. + // + template + struct view_object_image: object_traits_impl::image_type + { + view_object_image () {this->base = &base_;} + + private: + // Data member names in the generated image_type never end with + // an underscore, so this name shouldn't clash. + // + view_object_image::base_type, R, DB> + base_; + }; + + template + struct view_object_image: object_traits_impl::image_type {}; +} + +#include + +#endif // ODB_VIEW_IMAGE_HXX -- cgit v1.1