GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
signal_source_base.h
Go to the documentation of this file.
1/*!
2 * \file signal_source_base.h
3 * \brief Header file of the base class to signal_source GNSS blocks.
4 * \author Jim Melton, 2020. jim.melton(at)sncorp.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-2022 (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_SOURCE_BASE_H
19#define GNSS_SDR_SIGNAL_SOURCE_BASE_H
20
21#include "signal_source_interface.h"
22#include <cstddef>
23#include <string>
24
25
27
28class SignalSourceBase : public SignalSourceInterface
29{
30public:
31 std::string role() final;
32 std::string implementation() final;
33
34 size_t getRfChannels() const override;
35 gr::basic_block_sptr get_left_block() override; // non-sensical; implement once
36
37protected:
38 //! Constructor
39 SignalSourceBase(ConfigurationInterface const* configuration, std::string role, std::string impl);
40
41 //! utility for decoding passed ".item_type" values
42 //! @param[in] item_type - user provided string, should be one of the known types
43 //! @param[out] is_interleaved - if non-null, the pointed to memory is updated with
44 //! whether the data is interleaved I/Q (e.g., ishort)
45 //! @param[in] throw_on_error - if true, throw an exception if the string does not
46 //! represent a known type
47 //! @return the size in bytes of the passed type
48 size_t decode_item_type(std::string const& item_type, bool* is_interleaved = nullptr, bool throw_on_error = false);
49
50private:
51 std::string const role_;
52 std::string const implementation_;
53 size_t rfChannels_;
54};
55
56
57#endif
This abstract class represents an interface to configuration parameters.
SignalSourceBase(ConfigurationInterface const *configuration, std::string role, std::string impl)
Constructor.
size_t decode_item_type(std::string const &item_type, bool *is_interleaved=nullptr, bool throw_on_error=false)
utility for decoding passed ".item_type" values