diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-29 09:27:29 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2010-11-29 09:27:29 +0200 |
commit | 73edd8b28ac415b6fdb7d8c7f8728dc7f8de75d0 (patch) | |
tree | 6e0559cc3d74d62d1531ad2b2d509da978fb4afd /odb/context.hxx | |
parent | bdd75a3074e9c572187a24a38d37b9f1af742c7b (diff) |
Make container pragmas also work on types in addition to members
Diffstat (limited to 'odb/context.hxx')
-rw-r--r-- | odb/context.hxx | 17 |
1 files changed, 15 insertions, 2 deletions
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<bool> ("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<semantics::class_*> (&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> data_ptr; |