summaryrefslogtreecommitdiff
path: root/odb/common-query.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-01-17 12:49:09 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-01-17 12:49:09 +0200
commit5ae3932141c79e9240a34465b2608385275f2db5 (patch)
tree810529e92a6c057988f1f89c175b7ce7c15bef1d /odb/common-query.hxx
parenta680c33b7b15c4da6780b98a9fba6e4f09ba656f (diff)
Handle query column exporting for composite value types
A composite value is represented in query_columns as a nested struct. Even though the query_columns template instantiation is exported, VC++ for some reason doesn't appear to also export the nested structs. To work around this, nested structs have to have the export macro in the declaration. But that's not it: we also have to declare the nested structs extern, just like the outer template instantiation itself.
Diffstat (limited to 'odb/common-query.hxx')
-rw-r--r--odb/common-query.hxx18
1 files changed, 14 insertions, 4 deletions
diff --git a/odb/common-query.hxx b/odb/common-query.hxx
index b340b9f..5b0f71b 100644
--- a/odb/common-query.hxx
+++ b/odb/common-query.hxx
@@ -12,6 +12,16 @@
// Query-related generators.
//
+struct query_utils: virtual context
+{
+ void
+ inst_query_columns (bool decl, // Extern declaration or instanatiation.
+ bool ptr, // pointer_query_columns or query_columns
+ string const& type, // Object fq-type.
+ string const& alias, // Table alias.
+ semantics::class_&); // Traverse for nested structs.
+};
+
// Generate query tags for pointers in this objects.
//
struct query_tags: object_columns_base, virtual context
@@ -75,7 +85,7 @@ protected:
// Generate query columns in the query_columns_base class.
//
-struct query_columns_base: object_columns_base, virtual context
+struct query_columns_base: object_columns_base, query_utils
{
typedef query_columns_base base;
@@ -179,7 +189,7 @@ private:
// Generate explicit instantiations of base classes.
//
-struct query_columns_base_insts: traversal::class_, virtual context
+struct query_columns_base_insts: traversal::class_, query_utils
{
typedef query_columns_base_insts base;
@@ -203,7 +213,7 @@ private:
// Generate the query_columns_base/query_columns or pointer_query_columns
// classes for objects.
//
-struct query_columns_type: traversal::class_, virtual context
+struct query_columns_type: traversal::class_, query_utils
{
typedef query_columns_type base;
@@ -237,7 +247,7 @@ public:
// Generate the query_columns class for views.
//
-struct view_query_columns_type: traversal::class_, virtual context
+struct view_query_columns_type: traversal::class_, query_utils
{
typedef view_query_columns_type base;