1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-14 04:00:34 +00:00

Fix signature of copy and move operators

This commit is contained in:
Carles Fernandez 2020-05-16 14:39:34 +02:00
parent f9acf19fa7
commit 35ee34673a
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
7 changed files with 25 additions and 22 deletions

View File

@ -46,23 +46,23 @@ public:
// google::protobuf::ShutdownProtobufLibrary(); // 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_; 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_; this->monitor_ = rhs.monitor_;
return *this; 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_); 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) if (this != &other)
{ {

View File

@ -47,23 +47,23 @@ public:
google::protobuf::ShutdownProtobufLibrary(); 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; 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; this->observables = rhs.observables;
return *this; 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); 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) if (this != &other)
{ {

View File

@ -19,6 +19,7 @@
#include "gnss_satellite.h" #include "gnss_satellite.h"
#include <glog/logging.h> #include <glog/logging.h>
#include <utility>
Gnss_Satellite::Gnss_Satellite() Gnss_Satellite::Gnss_Satellite()
@ -80,7 +81,7 @@ bool operator==(const Gnss_Satellite& sat1, const Gnss_Satellite& sat2)
// Copy constructor // Copy constructor
Gnss_Satellite::Gnss_Satellite(Gnss_Satellite&& other) noexcept Gnss_Satellite::Gnss_Satellite(const Gnss_Satellite& other) noexcept
{ {
*this = other; *this = other;
} }
@ -102,9 +103,9 @@ Gnss_Satellite& Gnss_Satellite::operator=(const Gnss_Satellite& rhs)
// Move constructor // 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);
} }

View File

@ -51,9 +51,9 @@ public:
friend bool operator==(const Gnss_Satellite& /*sat1*/, const Gnss_Satellite& /*sat2*/); //!< operator== for comparison 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 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& 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 Gnss_Satellite& operator=(Gnss_Satellite&& other) noexcept; //!< Move assignment operator
private: private:

View File

@ -24,6 +24,7 @@
#include <boost/serialization/nvp.hpp> #include <boost/serialization/nvp.hpp>
#include <cstdint> #include <cstdint>
#include <utility>
/*! /*!
* \brief This is the class that contains the information that is shared * \brief This is the class that contains the information that is shared
@ -106,13 +107,13 @@ public:
~Gnss_Synchro() = default; //!< Default destructor ~Gnss_Synchro() = default; //!< Default destructor
/// Copy constructor /// Copy constructor
Gnss_Synchro(Gnss_Synchro&& other) noexcept Gnss_Synchro(const Gnss_Synchro& other) noexcept
{ {
*this = other; *this = other;
}; };
/// Copy assignment operator /// 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. // Only do assignment if RHS is a different object from this.
if (this != &rhs) if (this != &rhs)
@ -149,9 +150,9 @@ public:
}; };
/// Move constructor /// Move constructor
Gnss_Synchro(const Gnss_Synchro& other) noexcept Gnss_Synchro(Gnss_Synchro&& other) noexcept
{ {
*this = other; *this = std::move(other);
}; };
/// Move assignment operator /// Move assignment operator

View File

@ -23,6 +23,7 @@
#include <matio.h> #include <matio.h>
#include <cmath> #include <cmath>
#include <iostream> #include <iostream>
#include <utility>
bool Acquisition_Dump_Reader::read_binary_acq() bool Acquisition_Dump_Reader::read_binary_acq()
{ {
@ -232,7 +233,7 @@ Acquisition_Dump_Reader::Acquisition_Dump_Reader(const std::string& basename,
} }
// Copy constructor // 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; *this = other;
} }
@ -251,9 +252,9 @@ Acquisition_Dump_Reader& Acquisition_Dump_Reader::operator=(const Acquisition_Du
// Move constructor // 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);
} }

View File

@ -42,9 +42,9 @@ public:
~Acquisition_Dump_Reader() = default; ~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& 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 Acquisition_Dump_Reader& operator=(Acquisition_Dump_Reader&& other) noexcept; //!< Move assignment operator
bool read_binary_acq(); bool read_binary_acq();