aboutsummaryrefslogtreecommitdiff
path: root/odb/relational/header.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'odb/relational/header.hxx')
-rw-r--r--odb/relational/header.hxx218
1 files changed, 3 insertions, 215 deletions
diff --git a/odb/relational/header.hxx b/odb/relational/header.hxx
index fe08a49..75cee16 100644
--- a/odb/relational/header.hxx
+++ b/odb/relational/header.hxx
@@ -997,7 +997,7 @@ namespace relational
}
virtual void
- traverse_object (type& c);
+ traverse_object (type&);
virtual void
view_public_extra_pre (type&)
@@ -1010,222 +1010,10 @@ namespace relational
}
virtual void
- traverse_view (type& c)
- {
- string const& type (class_fq_name (c));
-
- os << "// " << class_name (c) << endl
- << "//" << endl;
-
- // class_traits
- //
- os << "template <>" << endl
- << "struct class_traits< " << type << " >"
- << "{"
- << "static const class_kind kind = class_view;"
- << "};";
-
- // view_traits
- //
- os << "template <>" << endl
- << "class access::view_traits< " << type << " >"
- << "{"
- << "public:" << endl;
-
- // view_type & pointer_type
- //
- os << "typedef " << type << " view_type;"
- << "typedef " << c.get<string> ("object-pointer") << " pointer_type;";
-
- os << "};";
-
- // view_traits_impl
- //
- os << "template <>" << endl
- << "class access::view_traits_impl< " << type << ", id_" <<
- db << " >:" << endl
- << " public access::view_traits< " << type << " >"
- << "{"
- << "public:" << endl;
-
- view_public_extra_pre (c);
-
- // image_type
- //
- image_type_->traverse (c);
-
- //
- // Query.
- //
-
- // query_base_type and query_columns (definition generated by class2).
- //
- os << "typedef " << db << "::query_base query_base_type;"
- << "struct query_columns";
-
- if (c.get<size_t> ("object-count") == 0)
- os << "{"
- << "};";
- else
- os << ";"
- << endl;
-
- //
- // Functions.
- //
-
- // grow ()
- //
- if (generate_grow)
- {
- os << "static bool" << endl
- << "grow (image_type&, " << truncated_vector << ");"
- << endl;
- }
-
- // bind (image_type)
- //
- os << "static void" << endl
- << "bind (" << bind_vector << ", image_type&);"
- << endl;
-
- // init (view, image)
- //
- os << "static void" << endl
- << "init (view_type&, const image_type&, database*);"
- << endl;
-
- // column_count
- //
- os << "static const std::size_t column_count = " <<
- column_count (c).total << "UL;"
- << endl;
-
- // Statements.
- //
- view_query& vq (c.get<view_query> ("query"));
-
- if (vq.kind != view_query::runtime)
- {
- os << "static query_base_type" << endl
- << "query_statement (const query_base_type&);"
- << endl;
- }
-
- //
- // Functions.
- //
-
- // callback ()
- //
- os << "static void" << endl
- << "callback (database&, view_type&, callback_event);"
- << endl;
-
- // query ()
- //
- if (!options.omit_unprepared ())
- os << "static result<view_type>" << endl
- << "query (database&, const query_base_type&);"
- << endl;
-
- view_public_extra_post (c);
-
- os << "};";
-
- // view_traits_impl< , id_default>
- //
- os << "template <>" << endl
- << "class access::view_traits_impl< " << type << ", " <<
- "id_default >:" << endl
- << " public access::view_traits_impl< " << type << ", " <<
- "id_" << db << " >"
- << "{"
- << "};";
- }
+ traverse_view (type&);
virtual void
- traverse_composite (type& c)
- {
- string const& type (class_fq_name (c));
-
- os << "// " << class_name (c) << endl
- << "//" << endl;
-
- os << "template <>" << endl
- << "struct class_traits< " << type << " >"
- << "{"
- << "static const class_kind kind = class_composite;"
- << "};";
-
- os << "template <>" << endl
- << "class access::composite_value_traits< " << type << ", " <<
- "id_" << db << " >"
- << "{"
- << "public:" << endl;
-
- // value_type
- //
- os << "typedef " << type << " value_type;"
- << endl;
-
- // image_type
- //
- image_type_->traverse (c);
-
- // Containers.
- //
- {
- instance<container_traits> t (c);
- t->traverse (c);
- }
-
- // grow ()
- //
- if (generate_grow)
- {
- os << "static bool" << endl
- << "grow (image_type&, " << truncated_vector << ");"
- << endl;
- }
-
- // bind (image_type)
- //
- os << "static void" << endl
- << "bind (" << bind_vector << ", image_type&, " <<
- db << "::statement_kind);"
- << endl;
-
- // init (image, value)
- //
- os << "static " << (generate_grow ? "bool" : "void") << endl
- << "init (image_type&, const value_type&, " <<
- db << "::statement_kind);"
- << endl;
-
- // init (value, image)
- //
- os << "static void" << endl
- << "init (value_type&, const image_type&, database*);"
- << endl;
-
- if (!has_a (c, test_container))
- {
- // get_null (image)
- //
- os << "static bool" << endl
- << "get_null (const image_type&);"
- << endl;
-
- // set_null (image)
- //
- os << "static void" << endl
- << "set_null (image_type&, " << db << "::statement_kind);"
- << endl;
- }
-
- os << "};";
- }
+ traverse_composite (type&);
private:
instance<image_type> image_type_;