GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
metrics.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004,2012,2018 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 
12 #ifndef METRICS_H
13 #define METRICS_H
14 
15 #include <gnuradio/block.h>
16 #include <gnuradio/trellis/api.h>
18 #include <cstdint>
19 
20 namespace gr {
21 namespace trellis {
22 
23 /*!
24  * \brief Evaluate metrics for use by the Viterbi algorithm.
25  * \ingroup trellis_coding_blk
26  */
27 template <class T>
28 class TRELLIS_API metrics : virtual public block
29 {
30 public:
31  // gr::trellis::metrics::sptr
32  typedef std::shared_ptr<metrics<T>> sptr;
33 
34  static sptr
35  make(int O, int D, const std::vector<T>& TABLE, digital::trellis_metric_type_t TYPE);
36 
37  virtual int O() const = 0;
38  virtual int D() const = 0;
39  virtual digital::trellis_metric_type_t TYPE() const = 0;
40  virtual std::vector<T> TABLE() const = 0;
41 
42  virtual void set_O(int O) = 0;
43  virtual void set_D(int D) = 0;
44  virtual void set_TYPE(digital::trellis_metric_type_t type) = 0;
45  virtual void set_TABLE(const std::vector<T>& table) = 0;
46 };
47 
48 
53 } /* namespace trellis */
54 } /* namespace gr */
55 
56 #endif /* METRICS_H */
#define D(...)
Definition: basic_block_pydoc_template.h:10
The abstract base class for all 'terminal' processing blocks.
Definition: gnuradio-runtime/include/gnuradio/block.h:63
Evaluate metrics for use by the Viterbi algorithm.
Definition: metrics.h:29
virtual void set_TYPE(digital::trellis_metric_type_t type)=0
virtual int D() const =0
virtual std::vector< T > TABLE() const =0
virtual digital::trellis_metric_type_t TYPE() const =0
virtual int O() const =0
static sptr make(int O, int D, const std::vector< T > &TABLE, digital::trellis_metric_type_t TYPE)
virtual void set_TABLE(const std::vector< T > &table)=0
std::shared_ptr< metrics< T > > sptr
Definition: metrics.h:32
virtual void set_D(int D)=0
virtual void set_O(int O)=0
#define TRELLIS_API
Definition: gr-trellis/include/gnuradio/trellis/api.h:18
trellis_metric_type_t
Definition: metric_type.h:17
metrics< gr_complex > metrics_c
Definition: metrics.h:52
metrics< std::int16_t > metrics_s
Definition: metrics.h:49
metrics< float > metrics_f
Definition: metrics.h:51
metrics< std::int32_t > metrics_i
Definition: metrics.h:50
GNU Radio logging wrapper.
Definition: basic_block.h:29