aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-09-06 16:56:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-09-06 16:56:07 +0200
commit7ce07d1c371e32e474897e8b03da7e330aaefb57 (patch)
tree2ee49af4fc317f189b9b12259fbabf16712cddb4
parent3ee1f474f72d093e27974e040372c53342702b12 (diff)
Support for views; native part
-rw-r--r--odb/pgsql/forward.hxx3
-rw-r--r--odb/pgsql/makefile1
-rw-r--r--odb/pgsql/object-result.hxx78
-rw-r--r--odb/pgsql/object-result.txx (renamed from odb/pgsql/result.txx)32
-rw-r--r--odb/pgsql/object-statements.hxx23
-rw-r--r--odb/pgsql/object-statements.txx6
-rw-r--r--odb/pgsql/query.hxx16
-rw-r--r--odb/pgsql/result.hxx64
-rw-r--r--odb/pgsql/statement-cache.hxx28
-rw-r--r--odb/pgsql/statements-base.cxx17
-rw-r--r--odb/pgsql/statements-base.hxx51
-rw-r--r--odb/pgsql/view-result.hxx70
-rw-r--r--odb/pgsql/view-result.txx95
-rw-r--r--odb/pgsql/view-statements.hxx111
-rw-r--r--odb/pgsql/view-statements.txx35
15 files changed, 533 insertions, 97 deletions
diff --git a/odb/pgsql/forward.hxx b/odb/pgsql/forward.hxx
index 046942d..0e1fb10 100644
--- a/odb/pgsql/forward.hxx
+++ b/odb/pgsql/forward.hxx
@@ -30,6 +30,9 @@ namespace odb
class object_statements;
template <typename T>
+ class view_statements;
+
+ template <typename T>
class container_statements;
}
diff --git a/odb/pgsql/makefile b/odb/pgsql/makefile
index 8203235..23b7903 100644
--- a/odb/pgsql/makefile
+++ b/odb/pgsql/makefile
@@ -15,6 +15,7 @@ error.cxx \
exceptions.cxx \
object-statements.cxx \
statement.cxx \
+statements-base.cxx \
traits.cxx \
transaction.cxx \
transaction-impl.cxx \
diff --git a/odb/pgsql/object-result.hxx b/odb/pgsql/object-result.hxx
new file mode 100644
index 0000000..1f5a9ca
--- /dev/null
+++ b/odb/pgsql/object-result.hxx
@@ -0,0 +1,78 @@
+// file : odb/pgsql/object-result.hxx
+// author : Constantin Michael <constantin@codesynthesis.com>
+// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_PGSQL_OBJECT_RESULT_HXX
+#define ODB_PGSQL_OBJECT_RESULT_HXX
+
+#include <odb/pre.hxx>
+
+#include <cstddef> // std::size_t
+
+#include <odb/details/shared-ptr.hxx>
+
+#include <odb/pgsql/version.hxx>
+#include <odb/pgsql/forward.hxx> // query, object_statements
+#include <odb/pgsql/result.hxx>
+#include <odb/pgsql/statement.hxx>
+
+namespace odb
+{
+ namespace pgsql
+ {
+ template <typename T>
+ class result_impl<T, class_object>:
+ public odb::result_impl<T, class_object>
+ {
+ public:
+ typedef odb::result_impl<T, class_object> base_type;
+
+ typedef typename base_type::pointer_type pointer_type;
+ typedef typename base_type::pointer_traits pointer_traits;
+
+ typedef typename base_type::object_type object_type;
+ typedef typename base_type::id_type id_type;
+ typedef typename base_type::object_traits object_traits;
+
+
+ virtual
+ ~result_impl ();
+
+ result_impl (const query&,
+ details::shared_ptr<select_statement>,
+ object_statements<object_type>&);
+
+ virtual void
+ load (object_type&);
+
+ virtual id_type
+ load_id ();
+
+ virtual void
+ next ();
+
+ virtual void
+ cache ();
+
+ virtual std::size_t
+ size ();
+
+ using base_type::current;
+
+ private:
+ void
+ load_image ();
+
+ private:
+ details::shared_ptr<select_statement> statement_;
+ object_statements<object_type>& statements_;
+ };
+ }
+}
+
+#include <odb/pgsql/object-result.txx>
+
+#include <odb/post.hxx>
+
+#endif // ODB_PGSQL_OBJECT_RESULT_HXX
diff --git a/odb/pgsql/result.txx b/odb/pgsql/object-result.txx
index a0dc2f8..f4ee961 100644
--- a/odb/pgsql/result.txx
+++ b/odb/pgsql/object-result.txx
@@ -1,34 +1,35 @@
-// file : odb/pgsql/result.txx
+// file : odb/pgsql/object-result.txx
// author : Constantin Michael <constantin@codesynthesis.com>
// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
#include <odb/callback.hxx>
-#include <odb/exceptions.hxx>
+
+#include <odb/pgsql/object-statements.hxx>
namespace odb
{
namespace pgsql
{
template <typename T>
- result_impl<T>::
+ result_impl<T, class_object>::
~result_impl ()
{
}
template <typename T>
- result_impl<T>::
+ result_impl<T, class_object>::
result_impl (const query&,
- details::shared_ptr<select_statement> st,
- object_statements<object_type>& sts)
- : odb::result_impl<T> (sts.connection ().database ()),
- statement_ (st),
- statements_ (sts)
+ details::shared_ptr<select_statement> statement,
+ object_statements<object_type>& statements)
+ : base_type (statements.connection ().database ()),
+ statement_ (statement),
+ statements_ (statements)
{
}
template <typename T>
- void result_impl<T>::
+ void result_impl<T, class_object>::
load (object_type& obj)
{
load_image ();
@@ -65,7 +66,8 @@ namespace odb
}
template <typename T>
- typename result_impl<T>::id_type result_impl<T>::
+ typename result_impl<T, class_object>::id_type
+ result_impl<T, class_object>::
load_id ()
{
load_image ();
@@ -73,7 +75,7 @@ namespace odb
}
template <typename T>
- void result_impl<T>::
+ void result_impl<T, class_object>::
next ()
{
this->current (pointer_type ());
@@ -83,7 +85,7 @@ namespace odb
}
template <typename T>
- void result_impl<T>::
+ void result_impl<T, class_object>::
load_image ()
{
// The image can grow between calls to load() as a result of other
@@ -118,13 +120,13 @@ namespace odb
}
template <typename T>
- void result_impl<T>::
+ void result_impl<T, class_object>::
cache ()
{
}
template <typename T>
- std::size_t result_impl<T>::
+ std::size_t result_impl<T, class_object>::
size ()
{
return statement_->result_size ();
diff --git a/odb/pgsql/object-statements.hxx b/odb/pgsql/object-statements.hxx
index ca5aecd..dc3c0db 100644
--- a/odb/pgsql/object-statements.hxx
+++ b/odb/pgsql/object-statements.hxx
@@ -21,6 +21,7 @@
#include <odb/pgsql/version.hxx>
#include <odb/pgsql/binding.hxx>
#include <odb/pgsql/statement.hxx>
+#include <odb/pgsql/statements-base.hxx>
#include <odb/pgsql/details/export.hxx>
@@ -28,20 +29,9 @@ namespace odb
{
namespace pgsql
{
- class connection;
-
- class LIBODB_PGSQL_EXPORT object_statements_base:
- public details::shared_base
+ class LIBODB_PGSQL_EXPORT object_statements_base: public statements_base
{
public:
- typedef pgsql::connection connection_type;
-
- connection_type&
- connection ()
- {
- return conn_;
- }
-
// Locking.
//
void
@@ -70,7 +60,7 @@ namespace odb
protected:
object_statements_base (connection_type& conn)
- : conn_ (conn), locked_ (false)
+ : statements_base (conn), locked_ (false)
{
}
@@ -91,7 +81,6 @@ namespace odb
};
protected:
- connection_type& conn_;
bool locked_;
};
@@ -152,10 +141,12 @@ namespace odb
bool locked_;
};
- //
- //
+ public:
object_statements (connection_type&);
+ virtual
+ ~object_statements ();
+
// Delayed loading.
//
void
diff --git a/odb/pgsql/object-statements.txx b/odb/pgsql/object-statements.txx
index c568ca7..c204ae6 100644
--- a/odb/pgsql/object-statements.txx
+++ b/odb/pgsql/object-statements.txx
@@ -18,6 +18,12 @@ namespace odb
{
template <typename T>
object_statements<T>::
+ ~object_statements ()
+ {
+ }
+
+ template <typename T>
+ object_statements<T>::
object_statements (connection_type& conn)
: object_statements_base (conn),
container_statement_cache_ (conn),
diff --git a/odb/pgsql/query.hxx b/odb/pgsql/query.hxx
index 96fa126..7633cc4 100644
--- a/odb/pgsql/query.hxx
+++ b/odb/pgsql/query.hxx
@@ -1674,7 +1674,7 @@ namespace odb
namespace odb
{
template <typename T>
- class query<T, pgsql::query>: public object_traits<T>::query_type
+ class query<T, pgsql::query>: public query_selector<T>::type
{
public:
// We don't define any typedefs here since they may clash with
@@ -1687,40 +1687,40 @@ namespace odb
explicit
query (const std::string& q)
- : object_traits<T>::query_type (q)
+ : query_selector<T>::type (q)
{
}
template <typename T2>
explicit
query (pgsql::val_bind<T2> v)
- : object_traits<T>::query_type (pgsql::query (v))
+ : query_selector<T>::type (pgsql::query (v))
{
}
template <typename T2>
explicit
query (pgsql::ref_bind<T2> r)
- : object_traits<T>::query_type (pgsql::query (r))
+ : query_selector<T>::type (pgsql::query (r))
{
}
query (const pgsql::query& q)
- : object_traits<T>::query_type (q)
+ : query_selector<T>::type (q)
{
}
template <pgsql::database_type_id ID>
query (const pgsql::query_column<bool, ID>& qc)
- : object_traits<T>::query_type (qc)
+ : query_selector<T>::type (qc)
{
}
std::string
clause () const
{
- return object_traits<T>::query_type::clause (
- object_traits<T>::table_name);
+ return query_selector<T>::type::clause (
+ query_selector<T>::table_name ());
}
};
}
diff --git a/odb/pgsql/result.hxx b/odb/pgsql/result.hxx
index 6a8b6a4..0e53e72 100644
--- a/odb/pgsql/result.hxx
+++ b/odb/pgsql/result.hxx
@@ -8,70 +8,28 @@
#include <odb/pre.hxx>
-#include <cstddef> // std::size_t
-
+#include <odb/traits.hxx>
#include <odb/result.hxx>
-#include <odb/details/shared-ptr.hxx>
#include <odb/pgsql/version.hxx>
-#include <odb/pgsql/forward.hxx> // query, query_params
-#include <odb/pgsql/statement.hxx>
-
-#include <odb/pgsql/details/export.hxx>
+#include <odb/pgsql/forward.hxx>
namespace odb
{
namespace pgsql
{
- template <typename T>
- class result_impl: public odb::result_impl<T>
- {
- public:
- typedef typename odb::result_impl<T>::pointer_type pointer_type;
- typedef typename odb::result_impl<T>::pointer_traits pointer_traits;
-
- typedef typename odb::result_impl<T>::object_type object_type;
- typedef typename odb::result_impl<T>::id_type id_type;
- typedef typename odb::result_impl<T>::object_traits object_traits;
-
-
- virtual
- ~result_impl ();
-
- result_impl (const query&,
- details::shared_ptr<select_statement>,
- object_statements<object_type>&);
-
- virtual void
- load (object_type&);
-
- virtual id_type
- load_id ();
-
- virtual void
- next ();
-
- virtual void
- cache ();
-
- virtual std::size_t
- size ();
-
- using odb::result_impl<T>::current;
-
- private:
- void
- load_image ();
-
- private:
- details::shared_ptr<select_statement> statement_;
- object_statements<object_type>& statements_;
- };
+ template <typename T, class_kind kind>
+ class result_impl;
}
}
-#include <odb/pgsql/result.txx>
-
#include <odb/post.hxx>
#endif // ODB_PGSQL_RESULT_HXX
+
+// Include result specializations so that the user code only needs
+// to include this header.
+//
+
+#include <odb/pgsql/object-result.hxx>
+#include <odb/pgsql/view-result.hxx>
diff --git a/odb/pgsql/statement-cache.hxx b/odb/pgsql/statement-cache.hxx
index 8164cd8..986aa9a 100644
--- a/odb/pgsql/statement-cache.hxx
+++ b/odb/pgsql/statement-cache.hxx
@@ -13,12 +13,14 @@
#include <odb/forward.hxx>
-#include <odb/pgsql/version.hxx>
-#include <odb/pgsql/object-statements.hxx>
-
#include <odb/details/shared-ptr.hxx>
#include <odb/details/type-info.hxx>
+#include <odb/pgsql/version.hxx>
+#include <odb/pgsql/statements-base.hxx>
+#include <odb/pgsql/object-statements.hxx>
+#include <odb/pgsql/view-statements.hxx>
+
#include <odb/pgsql/details/export.hxx>
namespace odb
@@ -37,7 +39,7 @@ namespace odb
template <typename T>
object_statements<T>&
- find ()
+ find_object ()
{
map::iterator i (map_.find (&typeid (T)));
@@ -51,9 +53,25 @@ namespace odb
return *p;
}
+ template <typename T>
+ view_statements<T>&
+ find_view ()
+ {
+ map::iterator i (map_.find (&typeid (T)));
+
+ if (i != map_.end ())
+ return static_cast<view_statements<T>&> (*i->second);
+
+ details::shared_ptr<view_statements<T> > p (
+ new (details::shared) view_statements<T> (conn_));
+
+ map_.insert (map::value_type (&typeid (T), p));
+ return *p;
+ }
+
private:
typedef std::map<const std::type_info*,
- details::shared_ptr<object_statements_base>,
+ details::shared_ptr<statements_base>,
details::type_info_comparator> map;
connection& conn_;
diff --git a/odb/pgsql/statements-base.cxx b/odb/pgsql/statements-base.cxx
new file mode 100644
index 0000000..749f8ce
--- /dev/null
+++ b/odb/pgsql/statements-base.cxx
@@ -0,0 +1,17 @@
+// file : odb/pgsql/statements-base.cxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#include <odb/pgsql/statements-base.hxx>
+
+namespace odb
+{
+ namespace pgsql
+ {
+ statements_base::
+ ~statements_base ()
+ {
+ }
+ }
+}
diff --git a/odb/pgsql/statements-base.hxx b/odb/pgsql/statements-base.hxx
new file mode 100644
index 0000000..54474dd
--- /dev/null
+++ b/odb/pgsql/statements-base.hxx
@@ -0,0 +1,51 @@
+// file : odb/pgsql/statements-base.hxx
+// author : Boris Kolpackov <boris@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_PGSQL_STATEMENTS_BASE_HXX
+#define ODB_PGSQL_STATEMENTS_BASE_HXX
+
+#include <odb/pre.hxx>
+
+#include <odb/details/shared-ptr.hxx>
+
+#include <odb/pgsql/version.hxx>
+#include <odb/pgsql/forward.hxx> // connection
+
+#include <odb/pgsql/details/export.hxx>
+
+namespace odb
+{
+ namespace pgsql
+ {
+ class LIBODB_PGSQL_EXPORT statements_base: public details::shared_base
+ {
+ public:
+ typedef pgsql::connection connection_type;
+
+ connection_type&
+ connection ()
+ {
+ return conn_;
+ }
+
+ public:
+ virtual
+ ~statements_base ();
+
+ protected:
+ statements_base (connection_type& conn)
+ : conn_ (conn)
+ {
+ }
+
+ protected:
+ connection_type& conn_;
+ };
+ }
+}
+
+#include <odb/post.hxx>
+
+#endif // ODB_PGSQL_STATEMENTS_BASE_HXX
diff --git a/odb/pgsql/view-result.hxx b/odb/pgsql/view-result.hxx
new file mode 100644
index 0000000..629778b
--- /dev/null
+++ b/odb/pgsql/view-result.hxx
@@ -0,0 +1,70 @@
+// file : odb/pgsql/view-result.hxx
+// author : Constantin Michael <constantin@codesynthesis.com>
+// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_PGSQL_VIEW_RESULT_HXX
+#define ODB_PGSQL_VIEW_RESULT_HXX
+
+#include <odb/pre.hxx>
+
+#include <cstddef> // std::size_t
+
+#include <odb/details/shared-ptr.hxx>
+
+#include <odb/pgsql/version.hxx>
+#include <odb/pgsql/forward.hxx> // query, view_statements
+#include <odb/pgsql/result.hxx>
+#include <odb/pgsql/statement.hxx>
+
+namespace odb
+{
+ namespace pgsql
+ {
+ template <typename T>
+ class result_impl<T, class_view>:
+ public odb::result_impl<T, class_view>
+ {
+ public:
+ typedef odb::result_impl<T, class_view> base_type;
+
+ typedef typename base_type::pointer_type pointer_type;
+ typedef typename base_type::pointer_traits pointer_traits;
+
+ typedef typename base_type::view_type view_type;
+ typedef typename base_type::view_traits view_traits;
+
+
+ virtual
+ ~result_impl ();
+
+ result_impl (const query&,
+ details::shared_ptr<select_statement>,
+ view_statements<view_type>&);
+
+ virtual void
+ load (view_type&);
+
+ virtual void
+ next ();
+
+ virtual void
+ cache ();
+
+ virtual std::size_t
+ size ();
+
+ using base_type::current;
+
+ private:
+ details::shared_ptr<select_statement> statement_;
+ view_statements<view_type>& statements_;
+ };
+ }
+}
+
+#include <odb/pgsql/view-result.txx>
+
+#include <odb/post.hxx>
+
+#endif // ODB_PGSQL_VIEW_RESULT_HXX
diff --git a/odb/pgsql/view-result.txx b/odb/pgsql/view-result.txx
new file mode 100644
index 0000000..63e5444
--- /dev/null
+++ b/odb/pgsql/view-result.txx
@@ -0,0 +1,95 @@
+// file : odb/pgsql/view-result.txx
+// author : Constantin Michael <constantin@codesynthesis.com>
+// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#include <odb/callback.hxx>
+
+#include <odb/pgsql/view-statements.hxx>
+
+namespace odb
+{
+ namespace pgsql
+ {
+ template <typename T>
+ result_impl<T, class_view>::
+ ~result_impl ()
+ {
+ }
+
+ template <typename T>
+ result_impl<T, class_view>::
+ result_impl (const query&,
+ details::shared_ptr<select_statement> statement,
+ view_statements<view_type>& statements)
+ : base_type (statements.connection ().database ()),
+ statement_ (statement),
+ statements_ (statements)
+ {
+ }
+
+ template <typename T>
+ void result_impl<T, class_view>::
+ load (view_type& view)
+ {
+ // The image can grow between calls to load() as a result of other
+ // statements execution.
+ //
+ typename view_traits::image_type& im (statements_.image ());
+
+ if (im.version != statements_.image_version ())
+ {
+ binding& b (statements_.image_binding ());
+ view_traits::bind (b.bind, im);
+ statements_.image_version (im.version);
+ b.version++;
+ }
+
+ select_statement::result r (statement_->load ());
+
+ if (r == select_statement::truncated)
+ {
+ if (view_traits::grow (im, statements_.image_truncated ()))
+ im.version++;
+
+ if (im.version != statements_.image_version ())
+ {
+ binding& b (statements_.image_binding ());
+ view_traits::bind (b.bind, im);
+ statements_.image_version (im.version);
+ b.version++;
+ statement_->reload ();
+ }
+ }
+
+ odb::database& db (this->database ());
+
+ view_traits::callback (db, view, callback_event::pre_load);
+ view_traits::init (view, im);
+ view_traits::callback (db, view, callback_event::post_load);
+ }
+
+ template <typename T>
+ void result_impl<T, class_view>::
+ next ()
+ {
+ this->current (pointer_type ());
+
+ if (!statement_->next ())
+ this->end_ = true;
+ }
+
+ template <typename T>
+ void result_impl<T, class_view>::
+ cache ()
+ {
+ }
+
+ template <typename T>
+ std::size_t result_impl<T, class_view>::
+ size ()
+ {
+ return statement_->result_size ();
+ }
+ }
+}
diff --git a/odb/pgsql/view-statements.hxx b/odb/pgsql/view-statements.hxx
new file mode 100644
index 0000000..e1e5614
--- /dev/null
+++ b/odb/pgsql/view-statements.hxx
@@ -0,0 +1,111 @@
+// file : odb/pgsql/view-statements.hxx
+// author : Constantin Michael <constantin@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#ifndef ODB_PGSQL_VIEW_STATEMENTS_HXX
+#define ODB_PGSQL_VIEW_STATEMENTS_HXX
+
+#include <odb/pre.hxx>
+
+#include <cstddef> // std::size_t
+
+#include <odb/forward.hxx>
+#include <odb/traits.hxx>
+
+#include <odb/details/shared-ptr.hxx>
+
+#include <odb/pgsql/version.hxx>
+#include <odb/pgsql/binding.hxx>
+#include <odb/pgsql/statement.hxx>
+#include <odb/pgsql/statements-base.hxx>
+
+namespace odb
+{
+ namespace pgsql
+ {
+ template <typename T>
+ class view_statements: public statements_base
+ {
+ public:
+ typedef T view_type;
+ typedef odb::view_traits<view_type> view_traits;
+ typedef typename view_traits::pointer_type pointer_type;
+ typedef typename view_traits::image_type image_type;
+
+ typedef pgsql::select_statement query_statement_type;
+
+ public:
+ view_statements (connection_type&);
+
+ virtual
+ ~view_statements ();
+
+ // View image.
+ //
+ image_type&
+ image ()
+ {
+ return image_;
+ }
+
+ std::size_t
+ image_version () const
+ {
+ return image_version_;
+ }
+
+ void
+ image_version (std::size_t v)
+ {
+ image_version_ = v;
+ }
+
+ binding&
+ image_binding ()
+ {
+ return image_binding_;
+ }
+
+ bool*
+ image_truncated ()
+ {
+ return image_truncated_;
+ }
+
+ query_statement_type&
+ query_statement ()
+ {
+ if (query_ == 0)
+ {
+ query_.reset (
+ new (details::shared) query_statement_type (
+ conn_,
+ view_traits::query_statement_name,
+ image_binding_));
+ }
+
+ return *query_;
+ }
+
+ private:
+ view_statements (const view_statements&);
+ view_statements& operator= (const view_statements&);
+
+ private:
+ image_type image_;
+ std::size_t image_version_;
+ binding image_binding_;
+ bind image_bind_[view_traits::column_count];
+ bool image_truncated_[view_traits::column_count];
+
+ details::shared_ptr<query_statement_type> query_;
+ };
+ }
+}
+
+#include <odb/pgsql/view-statements.txx>
+
+#include <odb/post.hxx>
+
+#endif // ODB_PGSQL_VIEW_STATEMENTS_HXX
diff --git a/odb/pgsql/view-statements.txx b/odb/pgsql/view-statements.txx
new file mode 100644
index 0000000..3ab3260
--- /dev/null
+++ b/odb/pgsql/view-statements.txx
@@ -0,0 +1,35 @@
+// file : odb/pgsql/view-statements.txx
+// author : Constantin Michael <constantin@codesynthesis.com>
+// copyright : Copyright (c) 2005-2011 Code Synthesis Tools CC
+// license : GNU GPL v2; see accompanying LICENSE file
+
+#include <cstddef> // std::size_t
+#include <cstring> // std::memset
+
+namespace odb
+{
+ namespace pgsql
+ {
+ template <typename T>
+ view_statements<T>::
+ ~view_statements ()
+ {
+ }
+
+ template <typename T>
+ view_statements<T>::
+ view_statements (connection_type& conn)
+ : statements_base (conn),
+ image_binding_ (image_bind_, view_traits::column_count)
+ {
+ image_.version = 0;
+ image_version_ = 0;
+
+ std::memset (image_bind_, 0, sizeof (image_bind_));
+ std::memset (image_truncated_, 0, sizeof (image_truncated_));
+
+ for (std::size_t i (0); i < view_traits::column_count; ++i)
+ image_bind_[i].truncated = image_truncated_ + i;
+ }
+ }
+}