GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
gnss_block_interface.h
Go to the documentation of this file.
1 /*!
2  * \file gnss_block_interface.h
3  * \brief This interface represents a GNSS block.
4  * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
5  *
6  * Abstract class for GNSS block interfaces. Since all its methods are virtual,
7  * this class cannot be instantiated directly, and a subclass can only be
8  * instantiated directly if all inherited pure virtual methods have been
9  * implemented by that class or a parent class.
10  *
11  * -----------------------------------------------------------------------------
12  *
13  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
14  *
15  * GNSS-SDR is a software defined Global Navigation
16  * Satellite Systems receiver
17  *
18  * This file is part of GNSS-SDR.
19  *
20  * SPDX-License-Identifier: GPL-3.0-or-later
21  *
22  * -----------------------------------------------------------------------------
23  */
24 
25 
26 #ifndef GNSS_SDR_GNSS_BLOCK_INTERFACE_H
27 #define GNSS_SDR_GNSS_BLOCK_INTERFACE_H
28 
29 #include <gnuradio/top_block.h>
30 #include <cassert>
31 #include <string>
32 
33 
34 /*!
35  * \brief This abstract class represents an interface to GNSS blocks.
36  *
37  * Abstract class for GNSS block interfaces. Since all its methods are virtual,
38  * this class cannot be instantiated directly, and a subclass can only be
39  * instantiated directly if all inherited pure virtual methods have been
40  * implemented by that class or a parent class.
41  */
43 {
44 public:
45  virtual ~GNSSBlockInterface() = default;
46  virtual std::string role() = 0;
47  virtual std::string implementation() = 0;
48  virtual size_t item_size() = 0;
49  virtual void connect(gr::top_block_sptr top_block) = 0;
50  virtual void disconnect(gr::top_block_sptr top_block) = 0;
51 
52  virtual gr::basic_block_sptr get_left_block() = 0;
53  virtual gr::basic_block_sptr get_right_block() = 0;
54 
55  virtual gr::basic_block_sptr get_left_block(int RF_channel)
56  {
57  assert(RF_channel >= 0);
58  if (RF_channel == 0)
59  {
60  }; // avoid unused param warning
61  return nullptr; // added to support raw array access (non pure virtual to allow left unimplemented)= 0;
62  }
63  virtual gr::basic_block_sptr get_right_block(int RF_channel)
64  {
65  assert(RF_channel >= 0);
66  if (RF_channel == 0)
67  {
68  }; // avoid unused param warning
69  return nullptr; // added to support raw array access (non pure virtual to allow left unimplemented)= 0;
70  }
71 };
72 
73 #endif // GNSS_SDR_GNSS_BLOCK_INTERFACE_H
This abstract class represents an interface to GNSS blocks.