bindings/python/utils/version.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2018-2021 CNRS INRIA
3 //
4 
8 
9 #include <boost/python.hpp>
10 
11 namespace pinocchio
12 {
13  namespace python
14  {
15 
16  namespace bp = boost::python;
17 
19  {
20  // Define release numbers of the current Pinocchio version.
21  bp::def_constant("PINOCCHIO_MAJOR_VERSION", PINOCCHIO_MAJOR_VERSION);
22  bp::def_constant("PINOCCHIO_MINOR_VERSION", PINOCCHIO_MINOR_VERSION);
23  bp::def_constant("PINOCCHIO_PATCH_VERSION", PINOCCHIO_PATCH_VERSION);
24 
25  bp::def(
26  "printVersion", printVersion, (bp::arg("delimiter") = "."),
27  "Returns the current version of Pinocchio as a string.\n"
28  "The user may specify the delimiter between the different semantic numbers.");
29 
30  bp::def(
31  "checkVersionAtLeast", &checkVersionAtLeast, bp::args("major", "minor", "patch"),
32  "Checks if the current version of Pinocchio is at least"
33  " the version provided by the input arguments.");
34  }
35 
36  } // namespace python
37 } // namespace pinocchio
boost::python
boost::python::def_constant
void def_constant(const char *name, const T &value)
Define a constant given its value and a name within the current Boost Python scope.
Definition: constant.hpp:24
version.hpp
version.hpp
python
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::python::exposeVersion
void exposeVersion()
Definition: bindings/python/utils/version.cpp:18
constant.hpp
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Sat Jun 1 2024 02:40:38