aboutsummaryrefslogtreecommitdiff
path: root/qt/common/containers/change-tracking/test.hxx
blob: 4c3614c72b8f3fe073f923a0a7626b1f12edc4bd (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
36
37
38
39
40
41
42
43
44
45
46
47
// file      : qt/common/containers/change-tracking/test.hxx
// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC
// license   : GNU GPL v2; see accompanying LICENSE file

#ifndef TEST_HXX
#define TEST_HXX

#include <common/config.hxx> // HAVE_CXX11

#include <memory>

#ifdef HAVE_CXX11
#  include <utility> // std::move
#endif

#include <QtCore/QString>

#include <odb/core.hxx>
#include <odb/qt/list.hxx>

#ifdef HAVE_CXX11
#pragma db object pointer(std::unique_ptr)
#else
#pragma db object pointer(std::auto_ptr)
#endif
struct object
{
  object () {}
  object (const QString& id): id_ (id) {}

#ifdef HAVE_CXX11
  object (const object& x): id_ (x.id_), i (x.i), s (x.s) {}
  object (object&& x): id_ (std::move (x.id_)), i (x.i), s (std::move (x.s)) {}
#endif

  #pragma db id
  QString id_;

  unsigned int i;

  QOdbList<QString> s;

  inline bool
  operator== (const object& o) {return id_ == o.id_ && i == o.i && s == o.s;}
};

#endif // TEST_HXX