Bayeux  3.4.1
Core Foundation library for SuperNEMO
version.h
Go to the documentation of this file.
1 //
7 // Copyright (c) 2013 by Ben Morgan <bmorgan.warwick@gmail.com>
8 // Copyright (c) 2013 by The University of Warwick
9 //
10 // This file is part of Bayeux.
11 //
12 // Bayeux is free software: you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation, either version 3 of the License, or
15 // (at your option) any later version.
16 //
17 // Bayeux is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with Bayeux. If not, see <http://www.gnu.org/licenses/>.
24 
25 #ifndef BAYEUX_VERSION_H
26 #define BAYEUX_VERSION_H
27 
28 // Standard Library
29 #include <iosfwd>
30 
31 //----------------------------------------------------------------------
32 // - Compile Time API
34 #define BAYEUX_VERSION_MAJOR 3
35 
37 #define BAYEUX_VERSION_MINOR 4
38 
40 #define BAYEUX_VERSION_PATCH 1
41 
43 #define BAYEUX_VERSION_REVISION 0
44 
46 #define BAYEUX_ENCODE_VERSION(major, minor, patch) (((major) * 10000) \
47  + ((minor) * 100) \
48  + ((patch) * 1))
49 
51 #define BAYEUX_VERSION BAYEUX_ENCODE_VERSION(BAYEUX_VERSION_MAJOR, \
52  BAYEUX_VERSION_MINOR, \
53  BAYEUX_VERSION_PATCH)
54 
56 #define BAYEUX_LIB_VERSION "3.4.1"
57 
59 #define BAYEUX_IS_AT_LEAST(major,minor,patch) (BAYEUX_VERSION >= \
60  BAYEUX_ENCODE_VERSION(major,minor,patch))
61 
62 //----------------------------------------------------------------------
63 // Runtime API
64 namespace bayeux {
65 
67  struct version {
68 
70  static int get_major();
71 
73  static int get_minor();
74 
76  static int get_patch();
77 
79  static int get_revision();
80 
82  static std::string get_version();
83 
85  static bool is_at_least(int major_, int minor_, int patch_);
86 
88  static bool has_feature(const std::string & feature_);
89 
90  };
91 
92 } // namespace bayeux
93 
94 #endif // BAYEUX_VERSION_H
95 
96 // Local Variables: --
97 // mode: c++ --
98 // c-file-style: "gnu" --
99 // tab-width: 2 --
100 // End: --
static bool is_at_least(int major_, int minor_, int patch_)
Return true if the current Bayeux version >= (major, minor, patch)
static int get_minor()
Return the minor version number of Bayeux, e.g., 2 for '1.2.3'.
static int get_major()
Return the major version number of Bayeux, e.g., 1 for '1.2.3'.
static int get_revision()
Return the revision/build number of Bayeux, e.g., 1234.
static int get_patch()
Return the patch version number of Bayeux, e.g., 3 for '1.2.3'.
static std::string get_version()
Return the full version number of Bayeux as a string, e.g., '1.2.3'.
Top-level namespace of the Bayeux library.
Definition: bayeux.h:42
Describe the Bayeux API version and features.
Definition: version.h:67
static bool has_feature(const std::string &feature_)
Return true if the named feature is available in Bayeux.