File: no-id-object-statements.txx

package info (click to toggle)
libodb-pgsql 2.4.0-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, forky, sid, stretch, trixie
  • size: 2,332 kB
  • ctags: 1,878
  • sloc: sh: 11,329; cpp: 2,832; makefile: 20
file content (47 lines) | stat: -rw-r--r-- 1,459 bytes parent folder | download
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
36
37
38
39
40
41
42
43
44
45
46
47
// file      : odb/pgsql/no-id-object-statements.txx
// copyright : Copyright (c) 2005-2015 Code Synthesis Tools CC
// license   : GNU GPL v2; see accompanying LICENSE file

#include <cstring> // std::memset

namespace odb
{
  namespace pgsql
  {
    //
    // no_id_object_statements
    //

    template <typename T>
    no_id_object_statements<T>::
    ~no_id_object_statements ()
    {
    }

    template <typename T>
    no_id_object_statements<T>::
    no_id_object_statements (connection_type& conn)
        : statements_base (conn),
          // select
          select_image_binding_ (select_image_bind_, select_column_count),
          // insert
          insert_image_binding_ (insert_image_bind_, insert_column_count),
          insert_image_native_binding_ (insert_image_values_,
                                        insert_image_lengths_,
                                        insert_image_formats_,
                                        insert_column_count)
    {
      image_.version = 0;
      select_image_version_ = 0;
      insert_image_version_ = 0;

      std::memset (insert_image_bind_, 0, sizeof (insert_image_bind_));
      std::memset (select_image_bind_, 0, sizeof (select_image_bind_));
      std::memset (
        select_image_truncated_, 0, sizeof (select_image_truncated_));

      for (std::size_t i (0); i < select_column_count; ++i)
        select_image_bind_[i].truncated = select_image_truncated_ + i;
    }
  }
}