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 mctools.
11 //
12 // mctools 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 // mctools 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 mctools. If not, see <http://www.gnu.org/licenses/>.
24 
25 #ifndef MCTOOLS_VERSION_H
26 #define MCTOOLS_VERSION_H
27 
28 // Standard Library:
29 #include <string>
30 
31 //----------------------------------------------------------------------
32 // - Compile Time API
34 #define MCTOOLS_VERSION_MAJOR 2
35 
37 #define MCTOOLS_VERSION_MINOR 2
38 
40 #define MCTOOLS_VERSION_PATCH 0
41 
43 #define MCTOOLS_ENCODE_VERSION(major_, minor_, patch_) ( \
44  ((major_) * 10000) \
45  + ((minor_) * 100) \
46  + ((patch_) * 1))
47 
49 #define MCTOOLS_VERSION MCTOOLS_ENCODE_VERSION( \
50  MCTOOLS_VERSION_MAJOR, \
51  MCTOOLS_VERSION_MINOR, \
52  MCTOOLS_VERSION_PATCH)
53 
55 #define MCTOOLS_LIB_VERSION "2.2.0"
56 
58 #define MCTOOLS_IS_AT_LEAST(major_,minor_,patch_) ( \
59  MCTOOLS_VERSION >= \
60  MCTOOLS_ENCODE_VERSION(major_,minor_,patch_))
61 
62 //----------------------------------------------------------------------
63 // Runtime API
64 namespace mctools {
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 std::string get_version();
80 
82  static bool is_at_least(int major_, int minor_, int patch_);
83 
85  static bool has_feature(const std::string & feature_);
86  };
87 
88 } // namespace mctools
89 
90 #endif // MCTOOLS_VERSION_H
91 
92 // Local Variables: --
93 // mode: c++ --
94 // c-file-style: "gnu" --
95 // tab-width: 2 --
96 // End: --
static int get_minor()
Return the minor version number of mctools, e.g., 2 for '1.2.3'.
Definition: base_step_hit.h:32
Describe the mctools API version and features.
Definition: version.h:67
static std::string get_version()
Return the full version number of mctools as a string, e.g., '1.2.3'.
static int get_major()
Return the major version number of mctools, e.g., 1 for '1.2.3'.
static bool has_feature(const std::string &feature_)
Return true if the named feature is available in mctools.
static bool is_at_least(int major_, int minor_, int patch_)
Return true if the current mctools version >= (major, minor, patch)
static int get_patch()
Return the patch version number of mctools, e.g., 3 for '1.2.3'.