Line data Source code
1 : /**
2 : * @file omponent_request.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 :
9 : #include "daqdataformats/ComponentRequest.hpp"
10 :
11 : #include <pybind11/pybind11.h>
12 : #include <pybind11/stl.h>
13 :
14 : #include <sstream>
15 :
16 : namespace py = pybind11;
17 :
18 : namespace dunedaq::daqdataformats::python {
19 :
20 : void
21 0 : register_component_request(py::module& m)
22 : {
23 :
24 0 : py::class_<ComponentRequest>(m, "ComponentRequest")
25 0 : .def(py::init())
26 0 : .def(py::init<SourceID const&, timestamp_t const&, timestamp_t const&>())
27 0 : .def("__str__",
28 0 : [](const ComponentRequest& cr) {
29 0 : std::ostringstream oss;
30 0 : oss << cr;
31 0 : return oss.str();
32 0 : })
33 0 : .def("__repr__",
34 0 : [](const ComponentRequest& cr) {
35 0 : std::ostringstream oss;
36 0 : oss << "<daqdataformats::ComponentRequest " << cr << ">";
37 0 : return oss.str();
38 0 : })
39 0 : .def_readonly_static("s_component_request_version", &ComponentRequest::s_component_request_version)
40 0 : .def_readonly("version", &ComponentRequest::version)
41 0 : .def_readonly("unused", &ComponentRequest::unused)
42 0 : .def_readonly("component", &ComponentRequest::component)
43 0 : .def_readonly("window_begin", &ComponentRequest::window_begin)
44 0 : .def_readonly("window_end", &ComponentRequest::window_end);
45 0 : }
46 :
47 : } // namespace dunedaq::daqdataformats::python
|