GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
gnss_sdr_fft.h
Go to the documentation of this file.
1 /*!
2  * \file gnss_sdr_fft.h
3  * \brief Helper file for FFT interface
4  * \author Carles Fernandez Prades, 2021. cfernandez(at)cttc.es
5  *
6  * -----------------------------------------------------------------------------
7  *
8  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
9  * This file is part of GNSS-SDR.
10  *
11  * Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
12  * SPDX-License-Identifier: GPL-3.0-or-later
13  *
14  * -----------------------------------------------------------------------------
15  */
16 
17 
18 #ifndef GNSS_SDR_GNSS_SDR_FFT_H
19 #define GNSS_SDR_GNSS_SDR_FFT_H
20 
21 #include "gnss_sdr_make_unique.h"
22 #include <gnuradio/fft/fft.h>
23 #include <memory>
24 #include <utility>
25 
26 #if GNURADIO_FFT_USES_TEMPLATES
27 using gnss_fft_complex_fwd = gr::fft::fft_complex_fwd;
28 using gnss_fft_complex_rev = gr::fft::fft_complex_rev;
29 template <typename T>
30 using gnss_fft_fwd_unique_ptr = std::unique_ptr<T>;
31 template <typename... Args>
32 gnss_fft_fwd_unique_ptr<gr::fft::fft_complex_fwd> gnss_fft_fwd_make_unique(Args&&... args)
33 {
34  return std::make_unique<gr::fft::fft_complex_fwd>(std::forward<Args>(args)...);
35 }
36 template <typename T>
37 using gnss_fft_rev_unique_ptr = std::unique_ptr<T>;
38 template <typename... Args>
39 gnss_fft_rev_unique_ptr<gr::fft::fft_complex_rev> gnss_fft_rev_make_unique(Args&&... args)
40 {
41  return std::make_unique<gr::fft::fft_complex_rev>(std::forward<Args>(args)...);
42 }
43 
44 #else
45 
46 using gnss_fft_complex_fwd = gr::fft::fft_complex;
47 using gnss_fft_complex_rev = gr::fft::fft_complex;
48 template <typename T>
49 using gnss_fft_fwd_unique_ptr = std::unique_ptr<T>;
50 template <typename... Args>
51 gnss_fft_fwd_unique_ptr<gr::fft::fft_complex> gnss_fft_fwd_make_unique(Args&&... args)
52 {
53  return std::make_unique<gr::fft::fft_complex>(std::forward<Args>(args)..., true);
54 }
55 template <typename T>
56 using gnss_fft_rev_unique_ptr = std::unique_ptr<T>;
57 template <typename... Args>
58 gnss_fft_rev_unique_ptr<gr::fft::fft_complex> gnss_fft_rev_make_unique(Args&&... args)
59 {
60  return std::make_unique<gr::fft::fft_complex>(std::forward<Args>(args)..., false);
61 }
62 
63 #endif
64 
65 #endif // GNSS_SDR_GNSS_SDR_FFT_H
This file implements std::make_unique for C++11.