-
Notifications
You must be signed in to change notification settings - Fork 193
/
VersionBindings.cpp
38 lines (31 loc) · 1.63 KB
/
VersionBindings.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "VersionBindings.hpp"
// depthai
#include "depthai/device/Version.hpp"
void VersionBindings::bind(pybind11::module& m, void* pCallstack){
using namespace dai;
// Type definitions
py::class_<Version> version(m, "Version", DOC(dai, Version));
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
// Call the rest of the type defines, then perform the actual bindings
Callstack* callstack = (Callstack*) pCallstack;
auto cb = callstack->top();
callstack->pop();
cb(m, pCallstack);
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////
// Bind DeviceBootloader
version
.def(py::init<const std::string&>(), py::arg("v"), DOC(dai, Version, Version))
.def(py::init<unsigned, unsigned, unsigned>(), py::arg("major"), py::arg("minor"), py::arg("patch"), DOC(dai, Version, Version, 2))
.def("__str__", &Version::toString, DOC(dai, Version, toString))
.def("__eq__", &Version::operator==)
.def("__lt__", &Version::operator<)
.def("__gt__", &Version::operator>)
.def("toStringSemver", &Version::toStringSemver, DOC(dai, Version, toStringSemver))
.def("getBuildInfo", &Version::getBuildInfo, DOC(dai, Version, getBuildInfo))
.def("getSemver", &Version::getSemver, DOC(dai, Version, getSemver))
;
}