From 73edd8b28ac415b6fdb7d8c7f8728dc7f8de75d0 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 29 Nov 2010 09:27:29 +0200 Subject: Make container pragmas also work on types in addition to members --- odb/context.hxx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'odb/context.hxx') diff --git a/odb/context.hxx b/odb/context.hxx index dde1d72..bc8a8bf 100644 --- a/odb/context.hxx +++ b/odb/context.hxx @@ -55,7 +55,10 @@ public: static bool comp_value (semantics::class_& c) { - return c.count ("value") && !c.count ("type"); + if (c.count ("composite-value")) + return c.get ("composite-value"); + else + return comp_value_ (c); } // Return the class object if this type is a composite value type @@ -65,7 +68,7 @@ public: comp_value (semantics::type& t) { semantics::class_* c (dynamic_cast (&t)); - return c != 0 && t.count ("value") && !t.count ("type") ? c : 0; + return c != 0 && comp_value (*c) ? c : 0; } static bool @@ -97,6 +100,12 @@ public: : 0; } + static bool + unordered (semantics::data_member& m) + { + return m.count ("unordered") || m.type ().count ("unordered"); + } + // Database names and types. // public: @@ -215,6 +224,10 @@ public: static bool has_a (semantics::type&, unsigned short flags); +private: + static bool + comp_value_ (semantics::class_&); + protected: struct data; typedef cutl::shared_ptr data_ptr; -- cgit v1.1