LCOV - code coverage report
Current view: top level - detdataformats/pybindsrc - hsi.cpp (source / functions) Coverage Total Hit
Test: code.result Lines: 0.0 % 23 0
Test Date: 2026-05-24 15:29:04 Functions: 0.0 % 12 0

            Line data    Source code
       1              : /**
       2              :  * @file hsi.cpp
       3              :  *
       4              :  * This is part of the DUNE DAQ Software Suite, copyright 2020.
       5              :  * Licensing/copyright details are in the COPYING file that you should have
       6              :  * received with this code.
       7              :  */
       8              : #include "detdataformats/HSIFrame.hpp"
       9              : 
      10              : #include <pybind11/pybind11.h>
      11              : #include <pybind11/stl.h>
      12              : 
      13              : namespace py = pybind11;
      14              : 
      15              : namespace dunedaq::detdataformats::python {
      16              : 
      17              : // Quiet the linter about use of unsigned ints in the file
      18              : // NOLINTBEGIN(build/unsigned)
      19              : 
      20              : void
      21            0 : register_hsi(py::module& m)
      22              : {
      23              : 
      24            0 :   py::class_<HSIFrame>(m, "HSIFrame", py::buffer_protocol())
      25            0 :     .def(py::init())
      26            0 :     .def(py::init([](py::capsule capsule) {
      27            0 :       auto hsfp = *static_cast<HSIFrame*>(capsule.get_pointer());
      28            0 :       return hsfp;
      29              :     }))
      30            0 :     .def(py::init([](py::bytes bytes) {
      31            0 :       py::buffer_info info(py::buffer(bytes).request());
      32            0 :       auto wfp = *static_cast<HSIFrame*>(info.ptr);
      33            0 :       return wfp;
      34            0 :     }))
      35            0 :     .def("get_timestamp", &HSIFrame::get_timestamp)
      36            0 :     .def_property_readonly("version", [](const HSIFrame& self) -> uint64_t { return self.version; })
      37            0 :     .def_property_readonly("detector_id", [](const HSIFrame& self) -> uint64_t { return self.detector_id; })
      38            0 :     .def_property_readonly("crate", [](const HSIFrame& self) -> uint64_t { return self.crate; })
      39            0 :     .def_property_readonly("slot", [](const HSIFrame& self) -> uint64_t { return self.slot; })
      40            0 :     .def_property_readonly("link", [](const HSIFrame& self) -> uint64_t { return self.link; })
      41            0 :     .def_property_readonly("input_low", [](const HSIFrame& self) -> uint64_t { return self.input_low; })
      42            0 :     .def_property_readonly("input_high", [](const HSIFrame& self) -> uint64_t { return self.input_high; })
      43            0 :     .def_property_readonly("trigger", [](const HSIFrame& self) -> uint64_t { return self.trigger; })
      44            0 :     .def_property_readonly("sequence", [](const HSIFrame& self) -> uint64_t { return self.sequence; })
      45            0 :     .def_static("sizeof", []() { return sizeof(HSIFrame); });
      46            0 : }
      47              : 
      48              : } // namespace dunedaq::detdataformats::python
      49              : 
      50              : // NOLINTEND(build/unsigned)
        

Generated by: LCOV version 2.0-1