/*
 * 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(metrics.h)                                        */
/* BINDTOOL_HEADER_FILE_HASH(07780ea3f13158c1311b8998e25c26d4)                     */
/***********************************************************************************/

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

namespace py = pybind11;

#include <gnuradio/trellis/metrics.h>
// pydoc.h is automatically generated in the build directory
#include <metrics_pydoc.h>

template <class T>
void bind_metrics_template(py::module& m, const char* classname)
{
    using metrics = gr::trellis::metrics<T>;
    py::class_<metrics, gr::block, gr::basic_block, std::shared_ptr<metrics>>(m,
                                                                              classname)
        .def(py::init(&gr::trellis::metrics<T>::make),
             py::arg("O"),
             py::arg("D"),
             py::arg("TABLE"),
             py::arg("TYPE"))
        .def("O", &metrics::O)
        .def("D", &metrics::D)
        .def("TABLE", &metrics::TABLE)
        .def("TYPE", &metrics::TYPE);
}
void bind_metrics(py::module& m)
{
    bind_metrics_template<std::int16_t>(m, "metrics_s");
    bind_metrics_template<std::int32_t>(m, "metrics_i");
    bind_metrics_template<float>(m, "metrics_f");
    bind_metrics_template<gr_complex>(m, "metrics_c");
}
