GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
fifo_signal_source.h
Go to the documentation of this file.
1/*!
2 * \file fifo_signal_source.h
3 *
4 * \brief Header file of the class for retrieving samples through a Unix FIFO
5 * \author Malte Lenhart, 2021. malte.lenhart(at)mailbox.org
6 *
7 *
8 * -----------------------------------------------------------------------------
9 *
10 * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
11 * This file is part of GNSS-SDR.
12 *
13 * Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
14 * SPDX-License-Identifier: GPL-3.0-or-later
15 *
16 * -----------------------------------------------------------------------------
17 */
18
19#ifndef GNSS_SDR_FIFO_SIGNAL_SOURCE_H
20#define GNSS_SDR_FIFO_SIGNAL_SOURCE_H
21
22#include "concurrent_queue.h"
23#include "signal_source_base.h"
24#include <pmt/pmt.h>
25#include <cstddef>
26#include <string>
27
28/** \addtogroup Signal_Source
29 * \{ */
30/** \addtogroup Signal_Source_adapters
31 * \{ */
32
33// forward declaration to avoid include in header
35
36//! \brief Class that reads a sample stream from a Unix FIFO.
37//!
38//! This class supports the following properties:
39//!
40//! .filename - the path to the input file
41//! - may be overridden by the -signal_source or -s command-line arguments
42//!
43//! .sample_type - data type read out from the FIFO. default ishort ;
44//! - note: not output format. that is always gr_complex
45//!
46//! .dump - whether to archive input data
47//!
48//! .dump_filename - if dumping, path to file for output
49//!
50class FifoSignalSource : public SignalSourceBase
51{
52public:
53 FifoSignalSource(const ConfigurationInterface* configuration, const std::string& role,
54 unsigned int in_streams, unsigned int out_streams,
56
57 ~FifoSignalSource() = default;
58
59 //! override methods from GNSSBlockInterface
60 void connect(gr::top_block_sptr top_block) override;
61 void disconnect(gr::top_block_sptr top_block) override;
62 size_t item_size() override;
63 gr::basic_block_sptr get_left_block() override;
64 gr::basic_block_sptr get_right_block() override;
65
66protected:
67private:
68 //! output size - always gr_complex
69 const size_t item_size_;
70 //! internal fifo_reader_ class acts as signal source
71 const gnss_shared_ptr<gr::block> fifo_reader_;
72
73 gnss_shared_ptr<gr::block> file_sink_;
74 const bool dump_;
75 const std::string dump_filename_;
76};
77
78/** \} */
79/** \} */
80#endif // GNSS_SDR_FIFO_SIGNAL_SOURCE_H
This class implements a thread-safe std::queue.
This abstract class represents an interface to configuration parameters.
void connect(gr::top_block_sptr top_block) override
override methods from GNSSBlockInterface
SignalSourceBase(ConfigurationInterface const *configuration, std::string role, std::string impl)
Constructor.
Interface of a thread-safe std::queue.
Header file of the base class to signal_source GNSS blocks.