1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-11-20 17:14:55 +00:00

Add a common shared pointer definition

Makes transition to GNU Radio 3.9 API less verbose
This commit is contained in:
Carles Fernandez
2020-11-03 20:51:57 +01:00
parent 165ae06d7a
commit f0e1ef6f9a
129 changed files with 315 additions and 1198 deletions

View File

@@ -22,6 +22,7 @@
#ifndef GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H
#define GNSS_SDR_GR_COMPLEX_IP_PACKET_SOURCE_H
#include "gnss_block_interface.h"
#include <boost/thread.hpp>
#include <gnuradio/sync_block.h>
#include <arpa/inet.h>
@@ -31,11 +32,6 @@
#include <pcap.h>
#include <string>
#include <sys/ioctl.h>
#if GNURADIO_USES_STD_POINTERS
#include <memory>
#else
#include <boost/shared_ptr.hpp>
#endif
/** \addtogroup Signal_Source
* \{ */
@@ -47,11 +43,7 @@
class Gr_Complex_Ip_Packet_Source : virtual public gr::sync_block
{
public:
#if GNURADIO_USES_STD_POINTERS
typedef std::shared_ptr<Gr_Complex_Ip_Packet_Source> sptr;
#else
typedef boost::shared_ptr<Gr_Complex_Ip_Packet_Source> sptr;
#endif
using sptr = gnss_shared_ptr<Gr_Complex_Ip_Packet_Source>;
static sptr make(std::string src_device,
const std::string &origin_address,
int udp_port,

View File

@@ -21,16 +21,12 @@
#define GNSS_SDR_LABSAT23_SOURCE_H
#include "concurrent_queue.h"
#include "gnss_block_interface.h"
#include <gnuradio/block.h>
#include <pmt/pmt.h>
#include <cstdint>
#include <fstream>
#include <string>
#if GNURADIO_USES_STD_POINTERS
#include <memory>
#else
#include <boost/shared_ptr.hpp>
#endif
/** \addtogroup Signal_Source
* \{ */
@@ -40,11 +36,7 @@
class labsat23_source;
#if GNURADIO_USES_STD_POINTERS
using labsat23_source_sptr = std::shared_ptr<labsat23_source>;
#else
using labsat23_source_sptr = boost::shared_ptr<labsat23_source>;
#endif
using labsat23_source_sptr = gnss_shared_ptr<labsat23_source>;
labsat23_source_sptr labsat23_make_source_sptr(
const char *signal_file_basename,

View File

@@ -27,6 +27,7 @@
#ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H
#define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_C_H
#include "gnss_block_interface.h"
#include "rtl_tcp_dongle_info.h"
#include <boost/array.hpp>
#include <boost/asio.hpp>
@@ -37,11 +38,6 @@
#include <cstdint>
#include <string>
#include <vector>
#if GNURADIO_USES_STD_POINTERS
#include <memory>
#else
#include <boost/shared_ptr.hpp>
#endif
/** \addtogroup Signal_Source
@@ -52,11 +48,7 @@
class rtl_tcp_signal_source_c;
#if GNURADIO_USES_STD_POINTERS
using rtl_tcp_signal_source_c_sptr = std::shared_ptr<rtl_tcp_signal_source_c>;
#else
using rtl_tcp_signal_source_c_sptr = boost::shared_ptr<rtl_tcp_signal_source_c>;
#endif
using rtl_tcp_signal_source_c_sptr = gnss_shared_ptr<rtl_tcp_signal_source_c>;
#if USE_BOOST_ASIO_IO_CONTEXT
using b_io_context = boost::asio::io_context;

View File

@@ -57,14 +57,10 @@
#ifndef GNSS_SDR_UNPACK_2BIT_SAMPLES_H
#define GNSS_SDR_UNPACK_2BIT_SAMPLES_H
#include "gnss_block_interface.h"
#include <gnuradio/sync_interpolator.h>
#include <cstdint>
#include <vector>
#if GNURADIO_USES_STD_POINTERS
#include <memory>
#else
#include <boost/shared_ptr.hpp>
#endif
/** \addtogroup Signal_Source
* \{ */
@@ -74,11 +70,7 @@
class unpack_2bit_samples;
#if GNURADIO_USES_STD_POINTERS
using unpack_2bit_samples_sptr = std::shared_ptr<unpack_2bit_samples>;
#else
using unpack_2bit_samples_sptr = boost::shared_ptr<unpack_2bit_samples>;
#endif
using unpack_2bit_samples_sptr = gnss_shared_ptr<unpack_2bit_samples>;
unpack_2bit_samples_sptr make_unpack_2bit_samples(
bool big_endian_bytes,

View File

@@ -24,12 +24,8 @@
#ifndef GNSS_SDR_UNPACK_BYTE_2BIT_CPX_SAMPLES_H
#define GNSS_SDR_UNPACK_BYTE_2BIT_CPX_SAMPLES_H
#include "gnss_block_interface.h"
#include <gnuradio/sync_interpolator.h>
#if GNURADIO_USES_STD_POINTERS
#include <memory>
#else
#include <boost/shared_ptr.hpp>
#endif
/** \addtogroup Signal_Source
* \{ */
@@ -39,11 +35,7 @@
class unpack_byte_2bit_cpx_samples;
#if GNURADIO_USES_STD_POINTERS
using unpack_byte_2bit_cpx_samples_sptr = std::shared_ptr<unpack_byte_2bit_cpx_samples>;
#else
using unpack_byte_2bit_cpx_samples_sptr = boost::shared_ptr<unpack_byte_2bit_cpx_samples>;
#endif
using unpack_byte_2bit_cpx_samples_sptr = gnss_shared_ptr<unpack_byte_2bit_cpx_samples>;
unpack_byte_2bit_cpx_samples_sptr make_unpack_byte_2bit_cpx_samples();

View File

@@ -20,12 +20,9 @@
#ifndef GNSS_SDR_UNPACK_BYTE_2BIT_SAMPLES_H
#define GNSS_SDR_UNPACK_BYTE_2BIT_SAMPLES_H
#include "gnss_block_interface.h"
#include <gnuradio/sync_interpolator.h>
#if GNURADIO_USES_STD_POINTERS
#include <memory>
#else
#include <boost/shared_ptr.hpp>
#endif
/** \addtogroup Signal_Source
* \{ */
@@ -34,11 +31,7 @@
class unpack_byte_2bit_samples;
#if GNURADIO_USES_STD_POINTERS
using unpack_byte_2bit_samples_sptr = std::shared_ptr<unpack_byte_2bit_samples>;
#else
using unpack_byte_2bit_samples_sptr = boost::shared_ptr<unpack_byte_2bit_samples>;
#endif
using unpack_byte_2bit_samples_sptr = gnss_shared_ptr<unpack_byte_2bit_samples>;
unpack_byte_2bit_samples_sptr make_unpack_byte_2bit_samples();

View File

@@ -20,12 +20,8 @@
#ifndef GNSS_SDR_UNPACK_INTSPIR_1BIT_SAMPLES_H
#define GNSS_SDR_UNPACK_INTSPIR_1BIT_SAMPLES_H
#include "gnss_block_interface.h"
#include <gnuradio/sync_interpolator.h>
#if GNURADIO_USES_STD_POINTERS
#include <memory>
#else
#include <boost/shared_ptr.hpp>
#endif
/** \addtogroup Signal_Source
@@ -36,11 +32,7 @@
class unpack_intspir_1bit_samples;
#if GNURADIO_USES_STD_POINTERS
using unpack_intspir_1bit_samples_sptr = std::shared_ptr<unpack_intspir_1bit_samples>;
#else
using unpack_intspir_1bit_samples_sptr = boost::shared_ptr<unpack_intspir_1bit_samples>;
#endif
using unpack_intspir_1bit_samples_sptr = gnss_shared_ptr<unpack_intspir_1bit_samples>;
unpack_intspir_1bit_samples_sptr make_unpack_intspir_1bit_samples();

View File

@@ -21,12 +21,8 @@
#ifndef GNSS_SDR_UNPACK_SPIR_GSS6450_SAMPLES_H
#define GNSS_SDR_UNPACK_SPIR_GSS6450_SAMPLES_H
#include "gnss_block_interface.h"
#include <gnuradio/sync_interpolator.h>
#if GNURADIO_USES_STD_POINTERS
#include <memory>
#else
#include <boost/shared_ptr.hpp>
#endif
/** \addtogroup Signal_Source
* \{ */
@@ -36,11 +32,7 @@
class unpack_spir_gss6450_samples;
#if GNURADIO_USES_STD_POINTERS
using unpack_spir_gss6450_samples_sptr = std::shared_ptr<unpack_spir_gss6450_samples>;
#else
using unpack_spir_gss6450_samples_sptr = boost::shared_ptr<unpack_spir_gss6450_samples>;
#endif
using unpack_spir_gss6450_samples_sptr = gnss_shared_ptr<unpack_spir_gss6450_samples>;
unpack_spir_gss6450_samples_sptr make_unpack_spir_gss6450_samples(int adc_nbit_);