1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-13 19:50: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();
}
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)
{

View File

@ -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)
{

View File

@ -19,6 +19,7 @@
#include "gnss_satellite.h"
#include <glog/logging.h>
#include <utility>
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);
}

View File

@ -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:

View File

@ -24,6 +24,7 @@
#include <boost/serialization/nvp.hpp>
#include <cstdint>
#include <utility>
/*!
* \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

View File

@ -23,6 +23,7 @@
#include <matio.h>
#include <cmath>
#include <iostream>
#include <utility>
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);
}

View File

@ -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();