clang format

This commit is contained in:
2021-10-19 14:49:43 +02:00
parent 3726ae3fd1
commit b39c64032d
66 changed files with 642 additions and 624 deletions

View File

@@ -2,10 +2,9 @@
// Copyright (C) 2021 Contributors to the SLS Detector Package
/*
This file contains Python bindings for the IpAddr and MacAddr
classes.
classes.
*/
#include <pybind11/chrono.h>
#include <pybind11/operators.h>
#include <pybind11/pybind11.h>
@@ -17,27 +16,25 @@ using sls::IpAddr;
using sls::MacAddr;
void init_network(py::module &m) {
py::class_ <IpAddr>(m, "IpAddr")
.def(py::init())
.def(py::init<const std::string&>())
.def(py::init<uint32_t>())
.def(py::init<const IpAddr&>())
.def("hex", &IpAddr::hex)
.def("uint32", &IpAddr::uint32)
.def(py::self == py::self)
.def("__repr__", &IpAddr::str)
.def("str", &IpAddr::str);
py::class_ <MacAddr>(m, "MacAddr")
.def(py::init())
.def(py::init<const std::string&>())
.def(py::init<uint64_t>())
.def(py::init<const MacAddr&>())
.def("hex", &MacAddr::hex)
.def(py::self == py::self)
.def("uint64", &MacAddr::uint64)
.def("__repr__", &MacAddr::str)
.def("str", &MacAddr::str);
py::class_<IpAddr>(m, "IpAddr")
.def(py::init())
.def(py::init<const std::string &>())
.def(py::init<uint32_t>())
.def(py::init<const IpAddr &>())
.def("hex", &IpAddr::hex)
.def("uint32", &IpAddr::uint32)
.def(py::self == py::self)
.def("__repr__", &IpAddr::str)
.def("str", &IpAddr::str);
py::class_<MacAddr>(m, "MacAddr")
.def(py::init())
.def(py::init<const std::string &>())
.def(py::init<uint64_t>())
.def(py::init<const MacAddr &>())
.def("hex", &MacAddr::hex)
.def(py::self == py::self)
.def("uint64", &MacAddr::uint64)
.def("__repr__", &MacAddr::str)
.def("str", &MacAddr::str);
}