utils/version.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018 CNRS
3 //
4 
5 #ifndef __pinocchio_utils_version_hpp__
6 #define __pinocchio_utils_version_hpp__
7 
8 #include "pinocchio/config.hpp"
9 
10 #include <string>
11 #include <sstream>
12 
13 namespace pinocchio
14 {
15 
21  inline std::string printVersion(const std::string & delimiter = ".")
22  {
23  std::ostringstream oss;
24  oss << PINOCCHIO_MAJOR_VERSION << delimiter << PINOCCHIO_MINOR_VERSION << delimiter
25  << PINOCCHIO_PATCH_VERSION;
26  return oss.str();
27  }
28 
40  inline bool checkVersionAtLeast(
41  unsigned int major_version, unsigned int minor_version, unsigned int patch_version)
42  {
43  return PINOCCHIO_MAJOR_VERSION > major_version
44  || (PINOCCHIO_MAJOR_VERSION >= major_version && (PINOCCHIO_MINOR_VERSION > minor_version || (PINOCCHIO_MINOR_VERSION >= minor_version && PINOCCHIO_PATCH_VERSION >= patch_version)));
45  }
46 } // namespace pinocchio
47 
48 #endif // __pinocchio_utils_version_hpp__
pinocchio::printVersion
std::string printVersion(const std::string &delimiter=".")
Returns the current version of Pinocchio as a string using the following standard: PINOCCHIO_MINOR_VE...
Definition: utils/version.hpp:21
pinocchio::checkVersionAtLeast
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: utils/version.hpp:40
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Sat Jun 22 2024 02:41:50