aboutsummaryrefslogtreecommitdiff
path: root/odb/mysql/container-statements.txx
blob: 18d78310ccf635f179d9049d62d7e660a454c22a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// file      : odb/mysql/container-statements.txx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : Copyright (c) 2005-2010 Code Synthesis Tools CC
// license   : GNU GPL v2; see accompanying LICENSE file

#include <cstddef> // std::size_t
#include <cstring> // std::memset

namespace odb
{
  namespace mysql
  {
    // container_statements
    //

    template <typename T>
    container_statements<T>::
    container_statements (connection_type& conn)
        : conn_ (conn),
          functions_ (this,
                      &traits::insert_one,
                      &traits::load_all,
                      &traits::delete_all),
          cond_image_binding_ (cond_image_bind_, traits::cond_column_count),
          data_image_binding_ (data_image_bind_, traits::data_column_count)
    {
      std::memset (cond_image_bind_, 0, sizeof (cond_image_bind_));
      std::memset (data_image_bind_, 0, sizeof (data_image_bind_));
      std::memset (data_image_error_, 0, sizeof (data_image_error_));

      for (std::size_t i (0); i < traits::data_column_count; ++i)
        data_image_bind_[i].error = data_image_error_ + i;
    }
  }
}