summaryrefslogtreecommitdiff
path: root/gr-blocks/python/blocks/bindings/file_source_python.cc
blob: 9be988fbb78ff4ba2c9aaf6e45a8e59cc6a9789d (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
/*
 * 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 */

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

namespace py = pybind11;

#include <gnuradio/blocks/file_source.h>
// pydoc.h is automatically generated in the build directory
#include <file_source_pydoc.h>

void bind_file_source(py::module& m)
{

    using file_source = ::gr::blocks::file_source;


    py::class_<file_source,
               gr::sync_block,
               gr::block,
               gr::basic_block,
               std::shared_ptr<file_source>>(m, "file_source", D(file_source))

        .def(py::init(&file_source::make),
             py::arg("itemsize"),
             py::arg("filename"),
             py::arg("repeat") = false,
             py::arg("offset") = 0,
             py::arg("len") = 0,
             D(file_source, make))


        .def("seek",
             &file_source::seek,
             py::arg("seek_point"),
             py::arg("whence"),
             D(file_source, seek))


        .def("open",
             &file_source::open,
             py::arg("filename"),
             py::arg("repeat"),
             py::arg("offset") = 0,
             py::arg("len") = 0,
             D(file_source, open))


        .def("close", &file_source::close, D(file_source, close))


        .def("set_begin_tag",
             &file_source::set_begin_tag,
             py::arg("val"),
             D(file_source, set_begin_tag))

        ;
}