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
hebi::getCVersion
VersionNumber getCVersion()
Returns the version numbers for the HEBI C API that is wrapped by this HEBI C++ API.
Definition: version.cpp:23
version.hpp
VersionChecker::VersionChecker
VersionChecker()
Definition: version.cpp:8
hebi::VersionNumber
A simple structure to hold a standard semantic versioning version number.
Definition: version.hpp:9
hebi
Definition: arm.cpp:5
check
static VersionChecker check
Definition: version.cpp:19
hebi.h
hebiGetLibraryVersion
HebiStatusCode hebiGetLibraryVersion(int32_t *major, int32_t *minor, int32_t *revision)
Get the version of the library.
VersionChecker
Definition: version.cpp:7
hebi::getCppVersion
VersionNumber getCppVersion()
Returns the version numbers for the HEBI C++ API.
Definition: version.cpp:29


hebi_cpp_api_ros
Author(s): Chris Bollinger , Matthew Tesch
autogenerated on Fri Aug 2 2024 08:35:18