GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
signal_conditioner.h
Go to the documentation of this file.
1 /*!
2  * \file signal_conditioner.h
3  * \brief It wraps blocks to change data type, filter and resample input data.
4  * \author Luis Esteve, 2012. luis(at)epsilon-formacion.com
5  *
6  *
7  * -----------------------------------------------------------------------------
8  *
9  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
10  * This file is part of GNSS-SDR.
11  *
12  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
13  * SPDX-License-Identifier: GPL-3.0-or-later
14  *
15  * -----------------------------------------------------------------------------
16  */
17 
18 #ifndef GNSS_SDR_SIGNAL_CONDITIONER_H
19 #define GNSS_SDR_SIGNAL_CONDITIONER_H
20 
21 #include "gnss_block_interface.h"
22 #include <gnuradio/block.h>
23 #include <cstddef>
24 #include <memory>
25 #include <string>
26 
27 /** \addtogroup Signal_Conditioner Signal Conditioner
28  * Signal Conditioner wrapper block
29  * \{ */
30 /** \addtogroup Signal_Conditioner_adapters conditioner_adapters
31  * Wrap a Signal Conditioner with a GNSSBlockInterface
32  * \{ */
33 
34 
35 /*!
36  * \brief This class wraps blocks to change data_type_adapter, input_filter and resampler
37  * to be applied to the input flow of sampled signal.
38  */
40 {
41 public:
42  //! Constructor
43  SignalConditioner(std::shared_ptr<GNSSBlockInterface> data_type_adapt,
44  std::shared_ptr<GNSSBlockInterface> in_filt,
45  std::shared_ptr<GNSSBlockInterface> res,
46  std::string role);
47 
48  //! Destructor
49  ~SignalConditioner() = default;
50 
51  void connect(gr::top_block_sptr top_block) override;
52  void disconnect(gr::top_block_sptr top_block) override;
53  gr::basic_block_sptr get_left_block() override;
54  gr::basic_block_sptr get_right_block() override;
55 
56  inline std::string role() override { return role_; }
57 
58  inline std::string implementation() override { return "Signal_Conditioner"; } //!< Returns "Signal_Conditioner"
59 
60  inline size_t item_size() override { return data_type_adapt_->item_size(); }
61 
62  inline std::shared_ptr<GNSSBlockInterface> data_type_adapter() { return data_type_adapt_; }
63  inline std::shared_ptr<GNSSBlockInterface> input_filter() { return in_filt_; }
64  inline std::shared_ptr<GNSSBlockInterface> resampler() { return res_; }
65 
66 private:
67  std::shared_ptr<GNSSBlockInterface> data_type_adapt_;
68  std::shared_ptr<GNSSBlockInterface> in_filt_;
69  std::shared_ptr<GNSSBlockInterface> res_;
70  std::string role_;
71  bool connected_;
72 };
73 
74 
75 /** \} */
76 /** \} */
77 #endif // GNSS_SDR_SIGNAL_CONDITIONER_H
~SignalConditioner()=default
Destructor.
This class wraps blocks to change data_type_adapter, input_filter and resampler to be applied to the ...
This interface represents a GNSS block.
SignalConditioner(std::shared_ptr< GNSSBlockInterface > data_type_adapt, std::shared_ptr< GNSSBlockInterface > in_filt, std::shared_ptr< GNSSBlockInterface > res, std::string role)
Constructor.
This abstract class represents an interface to GNSS blocks.
std::string implementation() override
Returns "Signal_Conditioner".