summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/python/gnuradio/gr/bindings/io_signature_python.cc
blob: 8f52e311f65f76493e1039f665786fe574a74697 (plain)
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
 * Copyright 2020 Free Software Foundation, Inc.
 *
 * This file is part of GNU Radio
 *
 * SPDX-License-Identifier: GPL-3.0-or-later
 *
 */

/***********************************************************************************/
/* This file is automatically generated using bindtool and can be manually edited  */
/* The following lines can be configured to regenerate this file during cmake      */
/* If manual edits are made, the following tags should be modified accordingly.    */
/* BINDTOOL_GEN_AUTOMATIC(0)                                                       */
/* BINDTOOL_USE_PYGCCXML(0)                                                        */
/* BINDTOOL_HEADER_FILE(io_signature.h)                                        */
/* BINDTOOL_HEADER_FILE_HASH(2d21df486462de11f4eb25681101c0c6)                     */
/***********************************************************************************/

#include <pybind11/complex.h>
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>

namespace py = pybind11;

#include <gnuradio/io_signature.h>
// pydoc.h is automatically generated in the build directory
#include <io_signature_pydoc.h>

void bind_io_signature(py::module& m)
{

    using io_signature = ::gr::io_signature;


    py::class_<io_signature, std::shared_ptr<io_signature>>(
        m, "io_signature", D(io_signature))

        .def(py::init(&io_signature::make),
             py::arg("min_streams"),
             py::arg("max_streams"),
             py::arg("sizeof_stream_item"),
             py::arg("buftype") = gr::buffer_double_mapped::type,
             D(io_signature, make))


        .def_static("make2",
                    &io_signature::make2,
                    py::arg("min_streams"),
                    py::arg("max_streams"),
                    py::arg("sizeof_stream_item1"),
                    py::arg("sizeof_stream_item2"),
                    py::arg("buftype1") = gr::buffer_double_mapped::type,
                    py::arg("buftype2") = gr::buffer_double_mapped::type,
                    D(io_signature, make2))


        .def_static("make3",
                    &io_signature::make3,
                    py::arg("min_streams"),
                    py::arg("max_streams"),
                    py::arg("sizeof_stream_item1"),
                    py::arg("sizeof_stream_item2"),
                    py::arg("sizeof_stream_item3"),
                    py::arg("buftype1") = gr::buffer_double_mapped::type,
                    py::arg("buftype2") = gr::buffer_double_mapped::type,
                    py::arg("buftype3") = gr::buffer_double_mapped::type,
                    D(io_signature, make3))

        .def_static(
            "makev",
            py::overload_cast<int, int, const std::vector<int>&>(&io_signature::makev),
            py::arg("min_streams"),
            py::arg("max_streams"),
            py::arg("sizeof_stream_items"),
            D(io_signature, makev))

        .def_static("makev",
                    py::overload_cast<int,
                                      int,
                                      const std::vector<int>&,
                                      gr::gr_vector_buffer_type>(&io_signature::makev),
                    py::arg("min_streams"),
                    py::arg("max_streams"),
                    py::arg("sizeof_stream_items"),
                    py::arg("buftypes"),
                    D(io_signature, makev))


        .def("min_streams", &io_signature::min_streams, D(io_signature, min_streams))


        .def("max_streams", &io_signature::max_streams, D(io_signature, max_streams))


        .def("sizeof_stream_item",
             &io_signature::sizeof_stream_item,
             py::arg("index"),
             D(io_signature, sizeof_stream_item))


        .def("sizeof_stream_items",
             &io_signature::sizeof_stream_items,
             D(io_signature, sizeof_stream_items))

        ;
}