aboutsummaryrefslogtreecommitdiff
path: root/common/types/test.hxx
blob: db4cdeb961bcdabc94619172e35892b4ac6241d6 (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
48
49
50
51
52
53
54
55
56
// file      : common/types/test.hxx
// copyright : Copyright (c) 2009-2015 Code Synthesis Tools CC
// license   : GNU GPL v2; see accompanying LICENSE file

#ifndef TEST_HXX
#define TEST_HXX

#ifdef ODB_COMPILER
typedef int int_t;
typedef short num_t;
#else
typedef int num_t;
#endif

typedef num_t num_type;

#pragma db object
struct object1
{
  typedef int int_type;

  #pragma db id
  int_type id_;
};

#pragma db object
struct object2
{
  #pragma db id
  num_type num_;
};

// Template-id with "inner" name (compilation test).
//
template <typename X>
struct num_wrap
{
#ifdef ODB_COMPILER
  typedef num_wrap this_type; // Name that we should not use.
#endif

  num_wrap () {}
  num_wrap (X v): v_ (v) {}
  operator X () const {return v_;}

  X v_;
};

#pragma db object
struct object3
{
  #pragma db id type("INTEGER")
  num_wrap<long long> num_; // Use long long to avoid warnings.
};

#endif // TEST_HXX