GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
byte_to_short.h
Go to the documentation of this file.
1 /*!
2  * \file byte_to_short.h
3  * \brief Adapts an 8-bits sample stream (IF) to a short int stream (IF)
4  * \author Carles Fernandez Prades, cfernandez(at)cttc.es
5  *
6  * -----------------------------------------------------------------------------
7  *
8  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
9  *
10  * GNSS-SDR is a software defined Global Navigation
11  * Satellite Systems receiver
12  *
13  * This file is part of GNSS-SDR.
14  *
15  * SPDX-License-Identifier: GPL-3.0-or-later
16  *
17  * -----------------------------------------------------------------------------
18  */
19 
20 #ifndef GNSS_SDR_BYTE_TO_SHORT_H
21 #define GNSS_SDR_BYTE_TO_SHORT_H
22 
23 #include "gnss_block_interface.h"
24 #include <gnuradio/blocks/char_to_short.h>
25 #include <gnuradio/blocks/file_sink.h>
26 #include <cstdint>
27 #include <string>
28 
30 
31 /*!
32  * \brief Adapts an 8-bits sample stream (IF) to a short int stream (IF)
33  *
34  */
36 {
37 public:
38  ByteToShort(const ConfigurationInterface* configuration,
39  std::string role, unsigned int in_streams,
40  unsigned int out_streams);
41 
42  ~ByteToShort() = default;
43 
44  inline std::string role() override
45  {
46  return role_;
47  }
48 
49  //! Returns "Byte_To_Short"
50  inline std::string implementation() override
51  {
52  return "Byte_To_Short";
53  }
54 
55  inline size_t item_size() override
56  {
57  return sizeof(int8_t);
58  }
59 
60  void connect(gr::top_block_sptr top_block) override;
61  void disconnect(gr::top_block_sptr top_block) override;
62  gr::basic_block_sptr get_left_block() override;
63  gr::basic_block_sptr get_right_block() override;
64 
65 private:
66  gr::blocks::char_to_short::sptr gr_char_to_short_;
67  gr::blocks::file_sink::sptr file_sink_;
68  std::string dump_filename_;
69  std::string input_item_type_;
70  std::string output_item_type_;
71  std::string role_;
72  unsigned int in_streams_;
73  unsigned int out_streams_;
74  bool dump_;
75 };
76 
77 #endif
This interface represents a GNSS block.
This abstract class represents an interface to configuration parameters.
std::string implementation() override
Returns "Byte_To_Short".
Definition: byte_to_short.h:50
This abstract class represents an interface to GNSS blocks.
Adapts an 8-bits sample stream (IF) to a short int stream (IF)
Definition: byte_to_short.h:35