Improve internal handling of Gnss_Synchro objects

Added noexcept move constructor and move assignment operator.
Small refactor of includes
This commit is contained in:
Carles Fernandez 2020-04-25 16:08:33 +02:00
parent fbd3485aed
commit b9c84a451e
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
14 changed files with 141 additions and 1 deletions

View File

@ -10,6 +10,12 @@ SPDX-FileCopyrightText: 2011-2020 Carles Fernandez-Prades <carles.fernandez@cttc
## Unreleased
### Improvements in Efficiency:
- Faster internal handling of `Gnss_Synchro` objects by reducing the amount of
copying via adding `noexcept` move constructor and move assignment operators,
so the move semantics are also used in STL containers.
### Improvements in Maintainability:
- The software can now be built against the GNU Radio 3.9 API that uses C++11

View File

@ -36,6 +36,7 @@
#include "beidou_b3i_signal_processing.h"
#include "galileo_e1_signal_processing.h"
#include "galileo_e5_signal_processing.h"
#include "gnss_satellite.h"
#include "gnss_sdr_create_directory.h"
#include "gnss_synchro.h"
#include "gps_l2c_signal.h"

View File

@ -30,6 +30,7 @@
#include "Galileo_E5a.h"
#include "MATH_CONSTANTS.h"
#include "fpga_multicorrelator.h"
#include "gnss_satellite.h"
#include "gnss_sdr_create_directory.h"
#include "gnss_synchro.h"
#include "gps_sdr_signal_processing.h"

View File

@ -29,6 +29,7 @@
#include "GPS_L1_CA.h"
#include "Galileo_E1.h"
#include "galileo_e1_signal_processing.h"
#include "gnss_satellite.h"
#include "gnss_sdr_flags.h"
#include "lock_detectors.h"
#include "tcp_communication.h"

View File

@ -28,6 +28,7 @@
#include "glonass_l1_ca_dll_pll_c_aid_tracking_cc.h"
#include "GLONASS_L1_L2_CA.h"
#include "glonass_l1_signal_processing.h"
#include "gnss_satellite.h"
#include "gnss_sdr_flags.h"
#include "lock_detectors.h"
#include "tracking_discriminators.h"

View File

@ -28,6 +28,7 @@
#include "glonass_l1_ca_dll_pll_c_aid_tracking_sc.h"
#include "GLONASS_L1_L2_CA.h"
#include "glonass_l1_signal_processing.h"
#include "gnss_satellite.h"
#include "gnss_sdr_flags.h"
#include "lock_detectors.h"
#include "tracking_discriminators.h"

View File

@ -28,6 +28,7 @@
#include "glonass_l1_ca_dll_pll_tracking_cc.h"
#include "GLONASS_L1_L2_CA.h"
#include "glonass_l1_signal_processing.h"
#include "gnss_satellite.h"
#include "gnss_sdr_flags.h"
#include "lock_detectors.h"
#include "tracking_discriminators.h"

View File

@ -26,6 +26,7 @@
#include "glonass_l2_ca_dll_pll_c_aid_tracking_cc.h"
#include "GLONASS_L1_L2_CA.h"
#include "glonass_l2_signal_processing.h"
#include "gnss_satellite.h"
#include "gnss_sdr_flags.h"
#include "lock_detectors.h"
#include "tracking_discriminators.h"

View File

@ -26,6 +26,7 @@
#include "glonass_l2_ca_dll_pll_c_aid_tracking_sc.h"
#include "GLONASS_L1_L2_CA.h"
#include "glonass_l2_signal_processing.h"
#include "gnss_satellite.h"
#include "gnss_sdr_flags.h"
#include "lock_detectors.h"
#include "tracking_discriminators.h"

View File

@ -28,6 +28,7 @@
#include "glonass_l2_ca_dll_pll_tracking_cc.h"
#include "GLONASS_L1_L2_CA.h"
#include "glonass_l2_signal_processing.h"
#include "gnss_satellite.h"
#include "gnss_sdr_flags.h"
#include "lock_detectors.h"
#include "tracking_discriminators.h"

View File

@ -19,6 +19,7 @@
#include "gps_l1_ca_dll_pll_tracking_gpu_cc.h"
#include "GPS_L1_CA.h"
#include "gnss_satellite.h"
#include "gnss_sdr_flags.h"
#include "gps_sdr_signal_processing.h"
#include "lock_detectors.h"

View File

@ -28,6 +28,7 @@
#include "gps_l1_ca_kf_tracking_cc.h"
#include "GPS_L1_CA.h"
#include "gnss_satellite.h"
#include "gnss_sdr_flags.h"
#include "gps_sdr_signal_processing.h"
#include "lock_detectors.h"

View File

@ -26,6 +26,7 @@
#include "gps_l1_ca_tcp_connector_tracking_cc.h"
#include "GPS_L1_CA.h"
#include "gnss_satellite.h"
#include "gnss_sdr_flags.h"
#include "gps_sdr_signal_processing.h"
#include "lock_detectors.h"

View File

@ -22,7 +22,6 @@
#ifndef GNSS_SDR_GNSS_SYNCHRO_H
#define GNSS_SDR_GNSS_SYNCHRO_H
#include "gnss_signal.h"
#include <boost/serialization/nvp.hpp>
#include <cstdint>
@ -68,6 +67,129 @@ public:
bool Flag_valid_pseudorange; //!< Set by Observables processing block
double interp_TOW_ms; //!< Set by Observables processing block
/// Constructor
Gnss_Synchro()
{
System = 0;
Signal[0] = 0;
Signal[1] = 0;
Signal[2] = '\0';
PRN = 0U;
Channel_ID = 0;
Acq_delay_samples = 0.0;
Acq_doppler_hz = 0.0;
Acq_samplestamp_samples = 0UL;
Acq_doppler_step = 0U;
Flag_valid_acquisition = false;
fs = 0L;
Prompt_I = 0.0;
Prompt_Q = 0.0;
CN0_dB_hz = 0.0;
Carrier_Doppler_hz = 0.0;
Carrier_phase_rads = 0.0;
Code_phase_samples = 0.0;
Tracking_sample_counter = 0UL;
Flag_valid_symbol_output = false;
correlation_length_ms = 0;
Flag_valid_word = false;
TOW_at_current_symbol_ms = 0U;
Pseudorange_m = 0.0;
RX_time = 0.0;
Flag_valid_pseudorange = false;
interp_TOW_ms = 0.0;
};
~Gnss_Synchro() = default; //!< Default destructor
/// Copy constructor
Gnss_Synchro(Gnss_Synchro&& other) noexcept
{
*this = other;
};
/// Copy assignment operator
Gnss_Synchro& operator=(const Gnss_Synchro& rhs)
{
// Only do assignment if RHS is a different object from this.
if (this != &rhs)
{
this->System = rhs.System;
this->Signal[0] = rhs.Signal[0];
this->Signal[1] = rhs.Signal[1];
this->Signal[2] = rhs.Signal[2];
this->PRN = rhs.PRN;
this->Channel_ID = rhs.Channel_ID;
this->Acq_delay_samples = rhs.Acq_delay_samples;
this->Acq_doppler_hz = rhs.Acq_doppler_hz;
this->Acq_samplestamp_samples = rhs.Acq_samplestamp_samples;
this->Acq_doppler_step = rhs.Acq_doppler_step;
this->Flag_valid_acquisition = rhs.Flag_valid_acquisition;
this->fs = rhs.fs;
this->Prompt_I = rhs.Prompt_I;
this->Prompt_Q = rhs.Prompt_Q;
this->CN0_dB_hz = rhs.CN0_dB_hz;
this->Carrier_Doppler_hz = rhs.Carrier_Doppler_hz;
this->Carrier_phase_rads = rhs.Carrier_phase_rads;
this->Code_phase_samples = rhs.Code_phase_samples;
this->Tracking_sample_counter = rhs.Tracking_sample_counter;
this->Flag_valid_symbol_output = rhs.Flag_valid_symbol_output;
this->correlation_length_ms = rhs.correlation_length_ms;
this->Flag_valid_word = rhs.Flag_valid_word;
this->TOW_at_current_symbol_ms = rhs.TOW_at_current_symbol_ms;
this->Pseudorange_m = rhs.Pseudorange_m;
this->RX_time = rhs.RX_time;
this->Flag_valid_pseudorange = rhs.Flag_valid_pseudorange;
this->interp_TOW_ms = rhs.interp_TOW_ms;
}
return *this;
};
/// Move constructor
Gnss_Synchro(const Gnss_Synchro& other) noexcept
{
*this = other;
};
/// Move assignment operator
Gnss_Synchro& operator=(Gnss_Synchro&& other) noexcept
{
if (this != &other)
{
this->System = other.System;
this->Signal[0] = other.Signal[0];
this->Signal[1] = other.Signal[1];
this->Signal[2] = other.Signal[2];
this->PRN = other.PRN;
this->Channel_ID = other.Channel_ID;
this->Acq_delay_samples = other.Acq_delay_samples;
this->Acq_doppler_hz = other.Acq_doppler_hz;
this->Acq_samplestamp_samples = other.Acq_samplestamp_samples;
this->Acq_doppler_step = other.Acq_doppler_step;
this->Flag_valid_acquisition = other.Flag_valid_acquisition;
this->fs = other.fs;
this->Prompt_I = other.Prompt_I;
this->Prompt_Q = other.Prompt_Q;
this->CN0_dB_hz = other.CN0_dB_hz;
this->Carrier_Doppler_hz = other.Carrier_Doppler_hz;
this->Carrier_phase_rads = other.Carrier_phase_rads;
this->Code_phase_samples = other.Code_phase_samples;
this->Tracking_sample_counter = other.Tracking_sample_counter;
this->Flag_valid_symbol_output = other.Flag_valid_symbol_output;
this->correlation_length_ms = other.correlation_length_ms;
this->Flag_valid_word = other.Flag_valid_word;
this->TOW_at_current_symbol_ms = other.TOW_at_current_symbol_ms;
this->Pseudorange_m = other.Pseudorange_m;
this->RX_time = other.RX_time;
this->Flag_valid_pseudorange = other.Flag_valid_pseudorange;
this->interp_TOW_ms = other.interp_TOW_ms;
}
return *this;
};
/*!
* \brief This member function serializes and restores
* Gnss_Synchro objects from a byte stream.