summaryrefslogtreecommitdiff
path: root/gnuradio-runtime/python/gnuradio/gr/bindings/realtime_impl_python.cc
blob: 792181483d0faabce3ea6384c61005740f041065 (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
/*
 * 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(realtime_impl.h)                                        */
/* BINDTOOL_HEADER_FILE_HASH(26d690b565b0b5c7489e5969d697ebf6)                     */
/***********************************************************************************/

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

namespace py = pybind11;

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

void bind_realtime_impl(py::module& m)
{


    py::enum_<::gr::rt_status_t>(m, "rt_status_t")
        .value("RT_OK", ::gr::RT_OK)                           // 0
        .value("RT_NOT_IMPLEMENTED", ::gr::RT_NOT_IMPLEMENTED) // 1
        .value("RT_NO_PRIVS", ::gr::RT_NO_PRIVS)               // 2
        .value("RT_OTHER_ERROR", ::gr::RT_OTHER_ERROR)         // 3
        .export_values();
    py::enum_<::gr::rt_sched_policy>(m, "rt_sched_policy")
        .value("RT_SCHED_RR", ::gr::RT_SCHED_RR)     // 0
        .value("RT_SCHED_FIFO", ::gr::RT_SCHED_FIFO) // 1
        .export_values();


    py::module m_impl = m.def_submodule("impl");

    using rt_sched_param = ::gr::impl::rt_sched_param;


    py::class_<rt_sched_param, std::shared_ptr<rt_sched_param>>(
        m_impl, "rt_sched_param", D(impl, rt_sched_param))

        .def(py::init<>(), D(impl, rt_sched_param, rt_sched_param, 0))
        .def(py::init<int, gr::rt_sched_policy>(),
             py::arg("priority_"),
             py::arg("policy_") = ::gr::rt_sched_policy::RT_SCHED_RR,
             D(impl, rt_sched_param, rt_sched_param, 1))
        .def(py::init<gr::impl::rt_sched_param const&>(),
             py::arg("arg0"),
             D(impl, rt_sched_param, rt_sched_param, 2))

        ;


    m_impl.def("rt_priority_min", &::gr::impl::rt_priority_min, D(impl, rt_priority_min));


    m_impl.def("rt_priority_max", &::gr::impl::rt_priority_max, D(impl, rt_priority_max));


    m_impl.def("rt_priority_default",
               &::gr::impl::rt_priority_default,
               D(impl, rt_priority_default));


    m_impl.def("enable_realtime_scheduling",
               &::gr::impl::enable_realtime_scheduling,
               py::arg("arg0") = gr::impl::rt_sched_param(),
               D(impl, enable_realtime_scheduling));
}