From 534da0d899b11f6ca1fac161ea8901a62e5c07dc Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 14 Aug 2013 15:16:09 +0200 Subject: Add support for object sections Sections are an optimization mechanism that allows the partitioning of data members of a persistent class into groups that can be separately loaded and/or updated. --- odb/sqlite/section-statements.txx | 42 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 odb/sqlite/section-statements.txx (limited to 'odb/sqlite/section-statements.txx') diff --git a/odb/sqlite/section-statements.txx b/odb/sqlite/section-statements.txx new file mode 100644 index 0000000..b6945d9 --- /dev/null +++ b/odb/sqlite/section-statements.txx @@ -0,0 +1,42 @@ +// file : odb/sqlite/section-statements.txx +// copyright : Copyright (c) 2005-2013 Code Synthesis Tools CC +// license : GNU GPL v2; see accompanying LICENSE file + +#include // std::memset + +namespace odb +{ + namespace sqlite + { + template + section_statements:: + section_statements (connection_type& conn, + image_type& im, + binding& id, binding& idv) + : conn_ (conn), + image_ (im), + id_binding_ (id), + idv_binding_ (idv), + select_image_binding_ (select_image_bind_, + select_column_count + + managed_optimistic_load_column_count), + update_image_binding_ (update_image_bind_, + update_column_count + id_column_count + + managed_optimistic_update_column_count) + { + select_image_version_ = 0; + update_image_version_ = 0; + update_id_binding_version_ = 0; + + std::memset (select_image_bind_, 0, sizeof (select_image_bind_)); + std::memset ( + select_image_truncated_, 0, sizeof (select_image_truncated_)); + std::memset (update_image_bind_, 0, sizeof (update_image_bind_)); + + for (std::size_t i (0); + i < select_column_count + managed_optimistic_load_column_count; + ++i) + select_image_bind_[i].truncated = select_image_truncated_ + i; + } + } +} -- cgit v1.1