Collage  1.0.1
Object-Oriented C++ Network Library
version.h
1 
2 /* Copyright (c) 2011-2012, Stefan Eilemann <eile@eyescale.ch>
3  *
4  * This file is part of Collage <https://github.com/Eyescale/Collage>
5  *
6  * This library is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License version 2.1 as published
8  * by the Free Software Foundation.
9  *
10  * This library is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this library; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef CO_VERSION_H
21 #define CO_VERSION_H
22 
23 #include <co/api.h>
24 #include <lunchbox/types.h>
25 #include <string>
26 
27 namespace co
28 {
29  // Collage version macros and functions
31 # define CO_VERSION_MAJOR 1
32 
34 # define CO_VERSION_MINOR 0
35 
37 # define CO_VERSION_PATCH 1
38 
40 # define CO_VERSION_REVISION 6cb3433
41 
43 # define CO_VERSION_ABI 1
44 
46 # define CO_LUNCHBOX_VERSION 1.8.0
47 
49 # define CO_VERSION_GT( MAJOR, MINOR, PATCH ) \
50  ( (CO_VERSION_MAJOR>MAJOR) || \
51  (CO_VERSION_MAJOR==MAJOR && (CO_VERSION_MINOR>MINOR || \
52  (CO_VERSION_MINOR==MINOR && CO_VERSION_PATCH>PATCH))))
53 
55 # define CO_VERSION_GE( MAJOR, MINOR, PATCH ) \
56  ( (CO_VERSION_MAJOR>MAJOR) || \
57  (CO_VERSION_MAJOR==MAJOR && (CO_VERSION_MINOR>MINOR || \
58  (CO_VERSION_MINOR==MINOR && CO_VERSION_PATCH>=PATCH))))
59 
61 # define CO_VERSION_LT( MAJOR, MINOR, PATCH ) \
62  ( (CO_VERSION_MAJOR<MAJOR) || \
63  (CO_VERSION_MAJOR==MAJOR && (CO_VERSION_MINOR<MINOR || \
64  (CO_VERSION_MINOR==MINOR && CO_VERSION_PATCH<PATCH))))
65 
67 # define CO_VERSION_LE( MAJOR, MINOR, PATCH ) \
68  ( (CO_VERSION_MAJOR<MAJOR) || \
69  (CO_VERSION_MAJOR==MAJOR && (CO_VERSION_MINOR<MINOR || \
70  (CO_VERSION_MINOR==MINOR && CO_VERSION_PATCH<=PATCH))))
71 
73  class CO_API Version
74  {
75  public:
77  static uint32_t getMajor();
78 
80  static uint32_t getMinor();
81 
83  static uint32_t getPatch();
84 
86  static std::string getRevision();
87 
89  static uint32_t getABI();
90 
92  static uint32_t getInt();
93 
95  static float getFloat();
96 
101  static std::string getString();
102 
107  static bool check()
108  { return getMajor()==CO_VERSION_MAJOR && getMinor()==CO_VERSION_MINOR; }
109  };
110 }
111 
112 #endif //CO_VERSION_H
Information about the current Collage version.
Definition: version.h:73
static bool check()
Definition: version.h:107