Common ODB Runtime Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
schema-version.hxx
Go to the documentation of this file.
1 // file : odb/schema-version.hxx
2 // copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
3 // license : GNU GPL v2; see accompanying LICENSE file
4 
5 #ifndef ODB_SCHEMA_VERSION_HXX
6 #define ODB_SCHEMA_VERSION_HXX
7 
8 #include <odb/pre.hxx>
9 
10 #include <odb/forward.hxx> // schema_version
11 #include <odb/details/export.hxx>
12 
13 namespace odb
14 {
15  struct LIBODB_EXPORT schema_version_migration
16  {
17  schema_version_migration (schema_version v = 0, bool m = false)
18  : version (v), migration (m) {}
19 
21  bool migration;
22  };
23 
24  // Version ordering is as follows: {1,f} < {2,t} < {2,f} < {3,t}
25  //
26  inline bool
28  const schema_version_migration& y)
29  {
30  return x.version == y.version && x.migration == y.migration;
31  }
32 
33  inline bool
35  const schema_version_migration& y)
36  {
37  return !(x == y);
38  }
39 
40  inline bool
42  const schema_version_migration& y)
43  {
44  return x.version < y.version ||
45  (x.version == y.version && x.migration && !y.migration);
46  }
47 
48  inline bool
50  const schema_version_migration& y)
51  {
52  return x.version > y.version ||
53  (x.version == y.version && !x.migration && y.migration);
54  }
55 
56  inline bool
58  const schema_version_migration& y)
59  {
60  return !(x > y);
61  }
62 
63  inline bool
65  const schema_version_migration& y)
66  {
67  return !(x < y);
68  }
69 }
70 
71 #include <odb/post.hxx>
72 
73 #endif // ODB_SCHEMA_VERSION_HXX
bool operator<=(const schema_version_migration &x, const schema_version_migration &y)
Definition: schema-version.hxx:57
bool operator>=(const schema_version_migration &x, const schema_version_migration &y)
Definition: schema-version.hxx:64
schema_version_migration(schema_version v=0, bool m=false)
Definition: schema-version.hxx:17
bool operator!=(const lazy_ptr< T > &, const lazy_ptr< Y > &)
schema_version version
Definition: schema-version.hxx:20
unsigned long long schema_version
Definition: forward.hxx:30
Definition: schema-version.hxx:15
bool operator<(const schema_version_migration &x, const schema_version_migration &y)
Definition: schema-version.hxx:41
bool operator==(const lazy_ptr< T > &, const lazy_ptr< Y > &)
bool migration
Definition: schema-version.hxx:21
bool operator>(const schema_version_migration &x, const schema_version_migration &y)
Definition: schema-version.hxx:49