/*
 * Copyright 2021 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(pdu_to_stream.h)                                        */
/* BINDTOOL_HEADER_FILE_HASH(2ad142c7be1b69014e96742965f63ede)                     */
/***********************************************************************************/

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

namespace py = pybind11;

#include <gnuradio/pdu/pdu_to_stream.h>
// pydoc.h is automatically generated in the build directory
#include <pdu_to_stream_pydoc.h>

template <typename T>
void bind_pdu_to_stream_template(py::module& m, const char* classname)
{
    using pdu_to_stream = ::gr::pdu::pdu_to_stream<T>;

    py::class_<pdu_to_stream, gr::block, gr::basic_block, std::shared_ptr<pdu_to_stream>>(
        m, classname)
        .def(py::init(&gr::pdu::pdu_to_stream<T>::make),
             py::arg("early_pdu_behavior"),
             py::arg("max_queue_size") = 64);
}

void bind_pdu_to_stream(py::module& m)
{
    py::enum_<::gr::pdu::early_pdu_behavior_t>(m, "early_pdu_behavior_t")
        .value("EARLY_BURST_APPEND", ::gr::pdu::EARLY_BURST_APPEND) // 0
        .value("EARLY_BURST_DROP", ::gr::pdu::EARLY_BURST_DROP)     // 1
        .value("EARLY_BURST_BALK", ::gr::pdu::EARLY_BURST_BALK)     // 2
        .export_values();

    py::implicitly_convertible<int, gr::pdu::early_pdu_behavior_t>();

    bind_pdu_to_stream_template<unsigned char>(m, "pdu_to_stream_b");
    bind_pdu_to_stream_template<short>(m, "pdu_to_stream_s");
    bind_pdu_to_stream_template<int>(m, "pdu_to_stream_i");
    bind_pdu_to_stream_template<float>(m, "pdu_to_stream_f");
    bind_pdu_to_stream_template<gr_complex>(m, "pdu_to_stream_c");
}
