mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-12-29 07:31:18 +01:00
Removing implicit conversions:
RegisterAddresss and RegisterValue: Removed the implicit conversions. RegisterAddress: Changed member name from address_ to value_ and method as well to value(). RegisterValue: Also added | operator to be able to concatenate with uint32_t. Same in python bindings (but could not find the tests to modify
This commit is contained in:
@@ -22,7 +22,7 @@ void init_bit(py::module &m) {
|
||||
.def(py::init<const RegisterAddress &>())
|
||||
.def("__repr__", &RegisterAddress::str)
|
||||
.def("str", &RegisterAddress::str)
|
||||
.def("uint32", [](const RegisterAddress &v) { return static_cast<uint32_t>(v); })
|
||||
.def("value", &RegisterAddress::value)
|
||||
.def(py::self == py::self)
|
||||
.def(py::self != py::self);
|
||||
|
||||
@@ -44,9 +44,12 @@ void init_bit(py::module &m) {
|
||||
.def(py::init<const RegisterValue &>())
|
||||
.def("__repr__", &RegisterValue::str)
|
||||
.def("str", &RegisterValue::str)
|
||||
.def("uint32", [](const RegisterValue &v) { return static_cast<uint32_t>(v); })
|
||||
.def("value", &RegisterValue::value)
|
||||
.def(py::self == py::self)
|
||||
.def(py::self != py::self)
|
||||
.def("__or__", [](const RegisterValue& v, uint32_t rhs) {
|
||||
return v | rhs;
|
||||
})
|
||||
.def("__ior__", [](RegisterValue &v, uint32_t rhs) -> RegisterValue& {
|
||||
v |= rhs;
|
||||
return v;
|
||||
|
||||
Reference in New Issue
Block a user