GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
gnss_block_factory.h
Go to the documentation of this file.
1 /*!
2  * \file gnss_block_factory.h
3  * \brief Interface of a factory that returns smart pointers to GNSS blocks.
4  * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
5  * Luis Esteve, 2011. luis(at)epsilon-formacion.com
6  * Javier Arribas, 2011. jarribas(at)cttc.es
7  * Carles Fernandez-Prades, 2014-2020. cfernandez(at)cttc.es
8  *
9  * This class encapsulates the complexity behind the instantiation
10  * of GNSS blocks.
11  *
12  *
13  * -----------------------------------------------------------------------------
14  *
15  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
16  * This file is part of GNSS-SDR.
17  *
18  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
19  * SPDX-License-Identifier: GPL-3.0-or-later
20  *
21  * -----------------------------------------------------------------------------
22  */
23 
24 #ifndef GNSS_SDR_BLOCK_FACTORY_H
25 #define GNSS_SDR_BLOCK_FACTORY_H
26 
27 #include "concurrent_queue.h"
28 #include <pmt/pmt.h>
29 #include <memory> // for unique_ptr
30 #include <string> // for string
31 #include <vector> // for vector
32 
33 /** \addtogroup Core
34  * \{ */
35 /** \addtogroup Core_Receiver
36  * \{ */
37 
38 
40 class GNSSBlockInterface;
43 class TrackingInterface;
45 
46 /*!
47  * \brief Class that produces all kinds of GNSS blocks
48  */
50 {
51 public:
52  GNSSBlockFactory() = default;
53  ~GNSSBlockFactory() = default;
54 
55  std::unique_ptr<SignalSourceInterface> GetSignalSource(const ConfigurationInterface* configuration,
56  Concurrent_Queue<pmt::pmt_t>* queue, int ID = -1);
57 
58  std::unique_ptr<GNSSBlockInterface> GetSignalConditioner(const ConfigurationInterface* configuration, int ID = -1);
59 
60  std::unique_ptr<std::vector<std::unique_ptr<GNSSBlockInterface>>> GetChannels(const ConfigurationInterface* configuration,
62 
63  std::unique_ptr<GNSSBlockInterface> GetObservables(const ConfigurationInterface* configuration);
64 
65  std::unique_ptr<GNSSBlockInterface> GetPVT(const ConfigurationInterface* configuration);
66 
67  /*!
68  * \brief Returns the block with the required role implementation and its configuration parameters
69  */
70  std::unique_ptr<GNSSBlockInterface> GetBlock(const ConfigurationInterface* configuration,
71  const std::string& role,
72  unsigned int in_streams,
73  unsigned int out_streams,
74  Concurrent_Queue<pmt::pmt_t>* queue = nullptr);
75 
76 private:
77  std::unique_ptr<GNSSBlockInterface> GetChannel(
78  const ConfigurationInterface* configuration,
79  const std::string& signal,
80  int channel,
82 
83  std::unique_ptr<AcquisitionInterface> GetAcqBlock(
84  const ConfigurationInterface* configuration,
85  const std::string& role,
86  unsigned int in_streams,
87  unsigned int out_streams);
88 
89  std::unique_ptr<TrackingInterface> GetTrkBlock(
90  const ConfigurationInterface* configuration,
91  const std::string& role,
92  unsigned int in_streams,
93  unsigned int out_streams);
94 
95  std::unique_ptr<TelemetryDecoderInterface> GetTlmBlock(
96  const ConfigurationInterface* configuration,
97  const std::string& role,
98  unsigned int in_streams,
99  unsigned int out_streams);
100 };
101 
102 
103 /** \} */
104 /** \} */
105 #endif // GNSS_SDR_BLOCK_FACTORY_H
Interface of a thread-safe std::queue.
This abstract class represents an interface to signal_source GNSS block.
This abstract class represents an interface to an acquisition GNSS block.
std::unique_ptr< GNSSBlockInterface > GetBlock(const ConfigurationInterface *configuration, const std::string &role, unsigned int in_streams, unsigned int out_streams, Concurrent_Queue< pmt::pmt_t > *queue=nullptr)
Returns the block with the required role implementation and its configuration parameters.
This abstract class represents an interface to configuration parameters.
Class that produces all kinds of GNSS blocks.
This abstract class represents an interface to a navigation GNSS block.
This abstract class represents an interface to GNSS blocks.
This abstract class represents an interface to a tracking block.