summaryrefslogtreecommitdiff
path: root/odb/relational/header.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-11-28 13:47:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-11-28 13:47:35 +0200
commit77d6727eddc64a95ccbdf87984e22270fce61b35 (patch)
tree8c119200e3e6c70c9a158a4212b4c93565a0bba9 /odb/relational/header.hxx
parent9ad0acf37561de9bf359a561faed53de17c2ca3b (diff)
Add support for DLL exporting of generated code
New options: --export-symbol, --extern-symbol.
Diffstat (limited to 'odb/relational/header.hxx')
-rw-r--r--odb/relational/header.hxx29
1 files changed, 17 insertions, 12 deletions
diff --git a/odb/relational/header.hxx b/odb/relational/header.hxx
index 89ef664..3e0480f 100644
--- a/odb/relational/header.hxx
+++ b/odb/relational/header.hxx
@@ -747,8 +747,8 @@ namespace relational
: id_image_member_ ("id_"),
version_image_member_ ("version_"),
discriminator_image_member_ ("discriminator_"),
- query_columns_type_ (false, true),
- pointer_query_columns_type_ (true, true)
+ query_columns_type_ (false, true, false),
+ pointer_query_columns_type_ (true, true, false)
{
}
@@ -758,8 +758,8 @@ namespace relational
id_image_member_ ("id_"),
version_image_member_ ("version_"),
discriminator_image_member_ ("discriminator_"),
- query_columns_type_ (false, true),
- pointer_query_columns_type_ (true, true)
+ query_columns_type_ (false, true, false),
+ pointer_query_columns_type_ (true, true, false)
{
}
@@ -823,7 +823,8 @@ namespace relational
typedef class2 base;
class2 ()
- : query_columns_type_ (false, true),
+ : query_columns_type_ (false, true, false),
+ query_columns_type_inst_ (false, false, true),
view_query_columns_type_ (true)
{
}
@@ -831,7 +832,8 @@ namespace relational
class2 (class_ const&)
: root_context (), //@@ -Wextra
context (),
- query_columns_type_ (false, true),
+ query_columns_type_ (false, true, false),
+ query_columns_type_inst_ (false, false, true),
view_query_columns_type_ (true)
{
}
@@ -855,19 +857,21 @@ namespace relational
{
if (options.generate_query ())
{
- bool has_ptr (has_a (c, test_pointer | include_base));
-
- if (has_ptr)
- os << "// " << class_name (c) << endl
- << "//" << endl;
+ os << "// " << class_name (c) << endl
+ << "//" << endl;
// query_columns
//
// If we don't have any pointers, then query_columns is generated
// in pass 1 (see the comment in class1 for details).
//
- if (has_ptr)
+ if (has_a (c, test_pointer | include_base))
query_columns_type_->traverse (c);
+
+ // Generate extern template declarations.
+ //
+ if (multi_dynamic)
+ query_columns_type_inst_->traverse (c);
}
// Move header comment out of if-block if adding any code here.
@@ -896,6 +900,7 @@ namespace relational
private:
instance<query_columns_type> query_columns_type_;
+ instance<query_columns_type> query_columns_type_inst_;
instance<view_query_columns_type> view_query_columns_type_;
};