version.cpp
Go to the documentation of this file.
1 #include "version.hpp"
2 
3 #include "hebi.h"
4 #include <cstdio>
5 #include <exception>
6 
7 struct VersionChecker {
9  auto version = hebi::getCVersion();
10  if (version.getMajor() != 2) {
11  fprintf(stderr,
12  "ERROR: Loaded an incompatible C API version (%d.%d.%d)\n",
13  version.getMajor(), version.getMinor(), version.getRevision());
14  std::terminate();
15  }
16  }
17 };
18 
20 
21 namespace hebi {
22 
24  int32_t maj, min, rev;
25  hebiGetLibraryVersion(&maj, &min, &rev);
26  return VersionNumber(maj, min, rev);
27 }
28 
30 
31 } // namespace hebi
Definition: arm.cpp:5
VersionNumber getCVersion()
Returns the version numbers for the HEBI C API that is wrapped by this HEBI C++ API.
Definition: version.cpp:23
HebiStatusCode hebiGetLibraryVersion(int32_t *major, int32_t *minor, int32_t *revision)
Get the version of the library.
static VersionChecker check
Definition: version.cpp:19
VersionNumber getCppVersion()
Returns the version numbers for the HEBI C++ API.
Definition: version.cpp:29
A simple structure to hold a standard semantic versioning version number.
Definition: version.hpp:9


hebi_cpp_api_ros
Author(s): Chris Bollinger , Matthew Tesch
autogenerated on Thu May 28 2020 03:14:45