Servus  1.5.1
C++ network oriented utilities including a zeroconf implementation
version.h
Go to the documentation of this file.
1 // generated by CommonLibrary.cmake, do not edit.
2 
8 #ifndef SERVUS_VERSION_H
9 #define SERVUS_VERSION_H
10 
11 #include <servus/api.h>
12 #include <string>
13 
14 namespace servus
15 {
17 # define SERVUS_VERSION_MAJOR 1
18 
20 # define SERVUS_VERSION_MINOR 5
21 
23 # define SERVUS_VERSION_PATCH 1
24 
26 # define SERVUS_VERSION_REVISION 0x6998512
27 
29 # define SERVUS_VERSION_ABI 5ull
30 
32 # define SERVUS_VERSION_GT( MAJOR, MINOR, PATCH ) \
33  ( (SERVUS_VERSION_MAJOR>MAJOR) || \
34  (SERVUS_VERSION_MAJOR==MAJOR && (SERVUS_VERSION_MINOR>MINOR || \
35  (SERVUS_VERSION_MINOR==MINOR && SERVUS_VERSION_PATCH>PATCH))))
36 
38 # define SERVUS_VERSION_GE( MAJOR, MINOR, PATCH ) \
39  ( (SERVUS_VERSION_MAJOR>MAJOR) || \
40  (SERVUS_VERSION_MAJOR==MAJOR && (SERVUS_VERSION_MINOR>MINOR || \
41  (SERVUS_VERSION_MINOR==MINOR && SERVUS_VERSION_PATCH>=PATCH))))
42 
44 # define SERVUS_VERSION_LT( MAJOR, MINOR, PATCH ) \
45  ( (SERVUS_VERSION_MAJOR<MAJOR) || \
46  (SERVUS_VERSION_MAJOR==MAJOR && (SERVUS_VERSION_MINOR<MINOR || \
47  (SERVUS_VERSION_MINOR==MINOR && SERVUS_VERSION_PATCH<PATCH))))
48 
50 # define SERVUS_VERSION_LE( MAJOR, MINOR, PATCH ) \
51  ( (SERVUS_VERSION_MAJOR<MAJOR) || \
52  (SERVUS_VERSION_MAJOR==MAJOR && (SERVUS_VERSION_MINOR<MINOR || \
53  (SERVUS_VERSION_MINOR==MINOR && SERVUS_VERSION_PATCH<=PATCH))))
54 
56 class SERVUS_API Version
57 {
58 public:
60  static int getMajor();
61 
63  static int getMinor();
64 
66  static int getPatch();
67 
69  static std::string getString();
70 
72  static unsigned long long getRevision();
73 
75  static int getABI();
76 
78  static std::string getRevString();
79 
88  static bool check()
89  {
90  return getMajor()==SERVUS_VERSION_MAJOR &&
91  getMinor()==SERVUS_VERSION_MINOR;
92  }
93 
95  static std::string getSchema()
96  {
97  return R"(
98  {
99  "title": "Version",
100  "type": "object",
101  "description": "Version information of the running application",
102  "properties": {
103  "major": { "type": "integer" },
104  "minor": { "type": "integer" },
105  "patch": { "type": "integer" },
106  "abi": { "type": "integer" },
107  "revision": { "type": "string" }
108  }
109  }
110  )";
111  }
112 
114  static std::string toJSON()
115  {
116  return R"(
117  {
118  "major": 1,
119  "minor": 5,
120  "patch": 1,
121  "abi": 5,
122  "revision": "6998512"
123  }
124  )";
125  }
126 };
127 
128 }
129 
130 #endif
#define SERVUS_VERSION_MAJOR
The current major version.
Definition: version.h:17
Defines export visibility macros for library Servus.
static std::string toJSON()
Definition: version.h:114
static bool check()
Runtime check for ABI compatibility.
Definition: version.h:88
static std::string getSchema()
Definition: version.h:95
Information about the current Servus version.
Definition: version.h:56
#define SERVUS_VERSION_MINOR
The current minor version.
Definition: version.h:20