From 428558c89850fe8c79b9c89a943bd996912d12f5 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Sep 2011 10:36:33 +0200 Subject: Support for views; native part --- odb/context.hxx | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'odb/context.hxx') diff --git a/odb/context.hxx b/odb/context.hxx index 75becef..e00ec4e 100644 --- a/odb/context.hxx +++ b/odb/context.hxx @@ -57,6 +57,16 @@ enum container_kind ck_multimap }; +// The same as class_kind in libodb/odb/traits.hxx. +// +enum class_kind +{ + class_object, + class_view, + class_composite, + class_other +}; + class context { public: @@ -84,6 +94,12 @@ public: } static bool + view (semantics::type& t) + { + return t.count ("view"); + } + + static bool transient (semantics::data_member& m) { return m.count ("transient"); @@ -177,6 +193,11 @@ public: bool null (semantics::data_member&, string const& key_prefix); + typedef ::class_kind class_kind_type; + + static class_kind_type + class_kind (semantics::class_&); + // Database names and types. // public: @@ -377,7 +398,7 @@ public: string const& key_prefix); bool - has_a (semantics::type&, unsigned short flags); + has_a (semantics::class_&, unsigned short flags); public: // Process include path by adding the prefix, putting it through @@ -480,12 +501,12 @@ public: bool embedded_schema; - // Outermost object currently being traversed. + // Outermost object or view currently being traversed. // semantics::class_*& top_object; - // Object currently being traversed. It can be the same as top_object - // or it can a base of top_object. + // Object or view currently being traversed. It can be the same as + // top_object or it can a base of top_object. // semantics::class_*& cur_object; -- cgit v1.1