pinocchio  UNKNOWN
version.hpp
1 //
2 // Copyright (c) 2018 CNRS
3 //
4 // This file is part of Pinocchio
5 // Pinocchio is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // Pinocchio is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // Pinocchio If not, see
16 // <http://www.gnu.org/licenses/>.
17 
18 #ifndef __se3_utils_version_hpp__
19 #define __se3_utils_version_hpp__
20 
21 #include "pinocchio/macros.hpp"
22 
23 #include <string>
24 #include <iostream>
25 
26 namespace se3
27 {
28 
34  std::string printVersion(const std::string & delimiter = ".")
35  {
36  std::ostringstream oss;
37  oss
38  << PINOCCHIO_MAJOR_VERSION << delimiter
39  << PINOCCHIO_MINOR_VERSION << delimiter
40  << PINOCCHIO_PATCH_VERSION;
41  return oss.str();
42  }
43 
55  bool checkVersionAtLeast(unsigned int major_version,
56  unsigned int minor_version,
57  unsigned int patch_version)
58  {
59  return
60  PINOCCHIO_MAJOR_VERSION > major_version
61  || (PINOCCHIO_MAJOR_VERSION >= major_version
62  && (PINOCCHIO_MINOR_VERSION > minor_version
63  || (PINOCCHIO_MINOR_VERSION >= minor_version
64  && PINOCCHIO_PATCH_VERSION >= patch_version)));
65  }
66 }
67 
68 #endif // __se3_utils_version_hpp__
bool checkVersionAtLeast(unsigned int major_version, unsigned int minor_version, unsigned int patch_version)
Checks if the current version of Pinocchio is at least the version provided by the input arguments...
Definition: version.hpp:55
std::string printVersion(const std::string &delimiter=".")
Returns the current version of Pinocchio as a string using the following standard: PINOCCHIO_MINOR_VE...
Definition: version.hpp:34