GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
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
22#include <gnuradio/fft/fft.h>
23#include <memory>
24#include <utility>
25
26#if GNURADIO_FFT_USES_TEMPLATES
27using gnss_fft_complex_fwd = gr::fft::fft_complex_fwd;
28using gnss_fft_complex_rev = gr::fft::fft_complex_rev;
29template <typename T>
30using gnss_fft_fwd_unique_ptr = std::unique_ptr<T>;
31template <typename... Args>
32gnss_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}
36template <typename T>
37using gnss_fft_rev_unique_ptr = std::unique_ptr<T>;
38template <typename... Args>
39gnss_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
46using gnss_fft_complex_fwd = gr::fft::fft_complex;
47using gnss_fft_complex_rev = gr::fft::fft_complex;
48template <typename T>
49using gnss_fft_fwd_unique_ptr = std::unique_ptr<T>;
50template <typename... Args>
51gnss_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}
55template <typename T>
56using gnss_fft_rev_unique_ptr = std::unique_ptr<T>;
57template <typename... Args>
58gnss_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.