pinocchio  2.4.4
A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives
version.hpp
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
25  << PINOCCHIO_MAJOR_VERSION << delimiter
26  << PINOCCHIO_MINOR_VERSION << delimiter
27  << PINOCCHIO_PATCH_VERSION;
28  return oss.str();
29  }
30 
42  inline bool checkVersionAtLeast(unsigned int major_version,
43  unsigned int minor_version,
44  unsigned int patch_version)
45  {
46  return
47  PINOCCHIO_MAJOR_VERSION > major_version
48  || (PINOCCHIO_MAJOR_VERSION >= major_version
49  && (PINOCCHIO_MINOR_VERSION > minor_version
50  || (PINOCCHIO_MINOR_VERSION >= minor_version
51  && PINOCCHIO_PATCH_VERSION >= patch_version)));
52  }
53 }
54 
55 #endif // __pinocchio_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:42
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:21
Main pinocchio namespace.
Definition: treeview.dox:24