diff --git a/src/algorithms/PVT/libs/serdes_monitor_pvt.h b/src/algorithms/PVT/libs/serdes_monitor_pvt.h index 894c60bad..1c1b5c9f2 100644 --- a/src/algorithms/PVT/libs/serdes_monitor_pvt.h +++ b/src/algorithms/PVT/libs/serdes_monitor_pvt.h @@ -46,23 +46,23 @@ public: // google::protobuf::ShutdownProtobufLibrary(); } - inline Serdes_Monitor_Pvt(Serdes_Monitor_Pvt&& other) //!< Copy constructor + inline Serdes_Monitor_Pvt(const Serdes_Monitor_Pvt& other) noexcept //!< Copy constructor { this->monitor_ = other.monitor_; } - inline Serdes_Monitor_Pvt& operator=(const Serdes_Monitor_Pvt& rhs) //!< Copy assignment operator + inline Serdes_Monitor_Pvt& operator=(const Serdes_Monitor_Pvt& rhs) noexcept //!< Copy assignment operator { this->monitor_ = rhs.monitor_; return *this; } - inline Serdes_Monitor_Pvt(const Serdes_Monitor_Pvt& other) //!< Move constructor + inline Serdes_Monitor_Pvt(Serdes_Monitor_Pvt&& other) noexcept //!< Move constructor { this->monitor_ = std::move(other.monitor_); } - inline Serdes_Monitor_Pvt& operator=(Serdes_Monitor_Pvt&& other) //!< Move assignment operator + inline Serdes_Monitor_Pvt& operator=(Serdes_Monitor_Pvt&& other) noexcept //!< Move assignment operator { if (this != &other) { diff --git a/src/core/monitor/serdes_gnss_synchro.h b/src/core/monitor/serdes_gnss_synchro.h index e76141b89..8a4c25c04 100644 --- a/src/core/monitor/serdes_gnss_synchro.h +++ b/src/core/monitor/serdes_gnss_synchro.h @@ -47,23 +47,23 @@ public: google::protobuf::ShutdownProtobufLibrary(); } - inline Serdes_Gnss_Synchro(Serdes_Gnss_Synchro&& other) //!< Copy constructor + inline Serdes_Gnss_Synchro(const Serdes_Gnss_Synchro& other) noexcept //!< Copy constructor { this->observables = other.observables; } - inline Serdes_Gnss_Synchro& operator=(const Serdes_Gnss_Synchro& rhs) //!< Copy assignment operator + inline Serdes_Gnss_Synchro& operator=(const Serdes_Gnss_Synchro& rhs) noexcept //!< Copy assignment operator { this->observables = rhs.observables; return *this; } - inline Serdes_Gnss_Synchro(const Serdes_Gnss_Synchro& other) //!< Move constructor + inline Serdes_Gnss_Synchro(Serdes_Gnss_Synchro&& other) noexcept //!< Move constructor { this->observables = std::move(other.observables); } - inline Serdes_Gnss_Synchro& operator=(Serdes_Gnss_Synchro&& other) //!< Move assignment operator + inline Serdes_Gnss_Synchro& operator=(Serdes_Gnss_Synchro&& other) noexcept //!< Move assignment operator { if (this != &other) { diff --git a/src/core/system_parameters/gnss_satellite.cc b/src/core/system_parameters/gnss_satellite.cc index b1e0dfdba..b7f455368 100644 --- a/src/core/system_parameters/gnss_satellite.cc +++ b/src/core/system_parameters/gnss_satellite.cc @@ -19,6 +19,7 @@ #include "gnss_satellite.h" #include +#include Gnss_Satellite::Gnss_Satellite() @@ -80,7 +81,7 @@ bool operator==(const Gnss_Satellite& sat1, const Gnss_Satellite& sat2) // Copy constructor -Gnss_Satellite::Gnss_Satellite(Gnss_Satellite&& other) noexcept +Gnss_Satellite::Gnss_Satellite(const Gnss_Satellite& other) noexcept { *this = other; } @@ -102,9 +103,9 @@ Gnss_Satellite& Gnss_Satellite::operator=(const Gnss_Satellite& rhs) // Move constructor -Gnss_Satellite::Gnss_Satellite(const Gnss_Satellite& other) noexcept +Gnss_Satellite::Gnss_Satellite(Gnss_Satellite&& other) noexcept { - *this = other; + *this = std::move(other); } diff --git a/src/core/system_parameters/gnss_satellite.h b/src/core/system_parameters/gnss_satellite.h index 4ecc45d79..fd57eb146 100644 --- a/src/core/system_parameters/gnss_satellite.h +++ b/src/core/system_parameters/gnss_satellite.h @@ -51,9 +51,9 @@ public: friend bool operator==(const Gnss_Satellite& /*sat1*/, const Gnss_Satellite& /*sat2*/); //!< operator== for comparison friend std::ostream& operator<<(std::ostream& /*out*/, const Gnss_Satellite& /*sat*/); //!< operator<< for pretty printing - Gnss_Satellite(Gnss_Satellite&& other) noexcept; //!< Copy constructor + Gnss_Satellite(const Gnss_Satellite& other) noexcept; //!< Copy constructor Gnss_Satellite& operator=(const Gnss_Satellite&); //!< Copy assignment operator - Gnss_Satellite(const Gnss_Satellite& other) noexcept; //!< Move constructor + Gnss_Satellite(Gnss_Satellite&& other) noexcept; //!< Move constructor Gnss_Satellite& operator=(Gnss_Satellite&& other) noexcept; //!< Move assignment operator private: diff --git a/src/core/system_parameters/gnss_synchro.h b/src/core/system_parameters/gnss_synchro.h index 12c58637d..8b8b9a345 100644 --- a/src/core/system_parameters/gnss_synchro.h +++ b/src/core/system_parameters/gnss_synchro.h @@ -24,6 +24,7 @@ #include #include +#include /*! * \brief This is the class that contains the information that is shared @@ -106,13 +107,13 @@ public: ~Gnss_Synchro() = default; //!< Default destructor /// Copy constructor - Gnss_Synchro(Gnss_Synchro&& other) noexcept + Gnss_Synchro(const Gnss_Synchro& other) noexcept { *this = other; }; /// Copy assignment operator - Gnss_Synchro& operator=(const Gnss_Synchro& rhs) + Gnss_Synchro& operator=(const Gnss_Synchro& rhs) noexcept { // Only do assignment if RHS is a different object from this. if (this != &rhs) @@ -149,9 +150,9 @@ public: }; /// Move constructor - Gnss_Synchro(const Gnss_Synchro& other) noexcept + Gnss_Synchro(Gnss_Synchro&& other) noexcept { - *this = other; + *this = std::move(other); }; /// Move assignment operator diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc index 023513b9c..391e05f0f 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.cc @@ -23,6 +23,7 @@ #include #include #include +#include bool Acquisition_Dump_Reader::read_binary_acq() { @@ -232,7 +233,7 @@ Acquisition_Dump_Reader::Acquisition_Dump_Reader(const std::string& basename, } // Copy constructor -Acquisition_Dump_Reader::Acquisition_Dump_Reader(Acquisition_Dump_Reader&& other) noexcept +Acquisition_Dump_Reader::Acquisition_Dump_Reader(const Acquisition_Dump_Reader& other) noexcept { *this = other; } @@ -251,9 +252,9 @@ Acquisition_Dump_Reader& Acquisition_Dump_Reader::operator=(const Acquisition_Du // Move constructor -Acquisition_Dump_Reader::Acquisition_Dump_Reader(const Acquisition_Dump_Reader& other) noexcept +Acquisition_Dump_Reader::Acquisition_Dump_Reader(Acquisition_Dump_Reader&& other) noexcept { - *this = other; + *this = std::move(other); } diff --git a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h index 05b51313c..cbcc4a36c 100644 --- a/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h +++ b/src/tests/unit-tests/signal-processing-blocks/libs/acquisition_dump_reader.h @@ -42,9 +42,9 @@ public: ~Acquisition_Dump_Reader() = default; - Acquisition_Dump_Reader(Acquisition_Dump_Reader&& other) noexcept; //!< Copy constructor + Acquisition_Dump_Reader(const Acquisition_Dump_Reader& other) noexcept; //!< Copy constructor Acquisition_Dump_Reader& operator=(const Acquisition_Dump_Reader&); //!< Copy assignment operator - Acquisition_Dump_Reader(const Acquisition_Dump_Reader& other) noexcept; //!< Move constructor + Acquisition_Dump_Reader(Acquisition_Dump_Reader&& other) noexcept; //!< Move constructor Acquisition_Dump_Reader& operator=(Acquisition_Dump_Reader&& other) noexcept; //!< Move assignment operator bool read_binary_acq();