removed operator= and copy ctor from classes where they only duplicated the behaviour of the default implementations that C++ generates automatically

This commit is contained in:
Mathew Sutcliffe
2013-08-19 03:21:12 +01:00
parent a6f89ce9ea
commit 21ca361bc1
32 changed files with 2 additions and 367 deletions

View File

@@ -22,17 +22,6 @@ QString CAltitude::convertToQString(bool /* i18n */) const
return s.append(this->m_msl ? " MSL" : " AGL");
}
/*
* Assigment
*/
CAltitude &CAltitude::operator =(const CAltitude &other)
{
if (this == &other) return *this;
CLength::operator = (other);
this->m_msl = other.m_msl;
return *this;
}
/*
* Equal?
*/

View File

@@ -78,19 +78,6 @@ public:
*/
CAltitude(BlackMisc::PhysicalQuantities::CLength altitude, bool msl) : BlackMisc::PhysicalQuantities::CLength(altitude), m_msl(msl) {}
/*!
* \brief Copy constructor
* \param other
*/
CAltitude(const CAltitude &other) : BlackMisc::PhysicalQuantities::CLength(other), m_msl(other.m_msl) {}
/*!
* \brief Assignment operator =
* \param other
* @return
*/
CAltitude &operator =(const CAltitude &other);
/*!
* \brief Equal operator ==
* \param other

View File

@@ -22,17 +22,6 @@ QString CHeading::convertToQString(bool i18n) const
return s.append(this->m_magnetic ? " magnetic" : " true");
}
/*
* Assigment
*/
CHeading& CHeading::operator =(const CHeading &other)
{
if (this == &other) return *this;
this->CAngle::operator = (other);
this->m_magnetic = other.m_magnetic;
return *this;
}
/*
* Equal?
*/

View File

@@ -78,19 +78,6 @@ public:
*/
CHeading(CAngle heading, bool magnetic) : CAngle(heading), m_magnetic(magnetic) {}
/*!
* \brief Copy constructor
* \param other
*/
CHeading(const CHeading &other) : CAngle(other), m_magnetic(other.m_magnetic) {}
/*!
* \brief Assignment operator =
* \param other
* @return
*/
CHeading &operator =(const CHeading &other);
/*!
* \brief Equal operator ==
* \param other

View File

@@ -121,17 +121,6 @@ public:
this->validate(true);
}
/*!
* \brief Assigment operator =
* \param otherSystem
* \return
*/
CAdfSystem &operator =(const CAdfSystem &otherSystem)
{
this->CModulator::operator =(otherSystem);
return *this;
}
/*!
* \brief operator ==
* \param otherSystem

View File

@@ -151,17 +151,6 @@ public:
this->setFrequencyActive(BlackMisc::PhysicalQuantities::CPhysicalQuantitiesConstants::FrequencyInternationalAirDistress());
}
/*!
* \brief Assigment operator =
* \param other
* \return
*/
CComSystem& operator =(const CComSystem &other)
{
this->CModulator::operator =(other);
return *this;
}
/*!
* \brief operator ==
* \param other

View File

@@ -35,19 +35,6 @@ template <class AVIO> void CModulator<AVIO>::registerMetadata()
qDBusRegisterMetaType<AVIO>();
}
/*
* Assigment operator =
*/
template <class AVIO> CModulator<AVIO>& CModulator<AVIO>::operator=(const CModulator<AVIO> &other)
{
if (this == &other) return *this;
this->m_frequencyActive = other.m_frequencyActive;
this->m_frequencyStandby = other.m_frequencyStandby;
this->m_digits = other.m_digits;
this->setName(other.getName());
return *this;
}
/*
* Equal operator ==
*/

View File

@@ -126,13 +126,6 @@ protected:
this->m_frequencyStandby = BlackMisc::PhysicalQuantities::CFrequency(frequencyMHz, BlackMisc::PhysicalQuantities::CFrequencyUnit::MHz());
}
/*!
* \brief Assigment operator =
* \param other
* \return
*/
CModulator &operator =(const CModulator &other);
/*!
* \brief operator ==
* \param other

View File

@@ -132,17 +132,6 @@ public:
this->validate(true);
}
/*!
* \brief Assigment operator =
* \param other
* \return
*/
CNavSystem &operator =(const CNavSystem &other)
{
this->CModulator::operator =(other);
return *this;
}
/*!
* \brief operator ==
* \param other

View File

@@ -224,19 +224,6 @@ public:
this->m_transponderCode = 2000;
}
/*!
* \brief Assigment operator =
* \param other
* \return
*/
CTransponder &operator =(const CTransponder &other)
{
this->CAvionicsBase::operator =(other);
this->m_transponderMode = other.m_transponderMode;
this->m_transponderCode = other.m_transponderCode;
return *this;
}
/*!
* \brief operator ==
* \param other

View File

@@ -22,17 +22,6 @@ QString CTrack::convertToQString(bool i18n) const
return s.append(this->m_magnetic ? " magnetic" : " true");
}
/*
* Assigment
*/
CTrack& CTrack::operator =(const CTrack &other)
{
if (this == &other) return *this;
this->CAngle::operator = (other);
this->m_magnetic = other.m_magnetic;
return *this;
}
/*
* Equal?
*/

View File

@@ -77,19 +77,6 @@ public:
*/
CTrack(BlackMisc::PhysicalQuantities::CAngle track, bool magnetic) : BlackMisc::PhysicalQuantities::CAngle(track), m_magnetic(magnetic) {}
/*!
* \brief Copy constructor
* \param other
*/
CTrack(const CTrack &other) : BlackMisc::PhysicalQuantities::CAngle(other), m_magnetic(other.m_magnetic) {}
/*!
* \brief Assignment operator =
* \param other
* \return
*/
CTrack &operator =(const CTrack &other);
/*!
* \brief Equal operator ==
* \param other

View File

@@ -194,20 +194,6 @@ public:
return !((*this) == other);
}
/*!
* \brief Assigment operator =
* \param other
* \return
*/
CCoordinateGeodetic &operator =(const CCoordinateGeodetic &other)
{
if (this == &other) return *this;
this->m_height = other.m_height;
this->m_latitude = other.m_latitude;
this->m_longitude = other.m_longitude;
return *this;
}
/*
* Register metadata
*/

View File

@@ -108,20 +108,6 @@ public:
return !((*this) == other);
}
/*!
* \brief Assigment operator =
* \param other
* \return
*/
CCoordinateNed &operator =(const CCoordinateNed &other)
{
if (this == &other) return *this;
this->CVector3DBase::operator = (other);
this->m_hasReferencePosition = other.m_hasReferencePosition;
this->m_referencePosition = other.m_referencePosition;
return *this;
}
/*!
* \brief Corresponding reference position
* \return

View File

@@ -50,12 +50,6 @@ protected:
*/
CEarthAngle() : CAngle(0.0, BlackMisc::PhysicalQuantities::CAngleUnit::deg()) {}
/*!
* \brief Copy constructor
* \param latOrLon
*/
CEarthAngle(const LATorLON &latOrLon) : CAngle(latOrLon) {}
/*!
* \brief Init by double value
* \param value
@@ -184,17 +178,6 @@ public:
return this->CAngle::operator >=(latOrLon);
}
/*!
* \brief Assignment operator =
* \param latOrLon
* \return
*/
CEarthAngle &operator =(const LATorLON &latOrLon)
{
this->CAngle::operator =(latOrLon);
return *this;
}
/*!
* \brief Plus operator +
* \param latOrLon

View File

@@ -31,12 +31,6 @@ public:
*/
CLatitude() : CEarthAngle() {}
/*!
* \brief Copy constructor
* \param other
*/
CLatitude(const CLatitude &other) : CEarthAngle(other) {}
/*!
* \brief Constructor
* \param angle

View File

@@ -28,12 +28,6 @@ public:
*/
CLongitude() : CEarthAngle() {}
/*!
* \brief Copy constructor
* \param other
*/
CLongitude(const CLongitude &other) : CEarthAngle(other) {}
/*!
* \brief Constructor
* \param angle

View File

@@ -140,18 +140,6 @@ public:
return !((*this) == other);
}
/*!
* \brief Assigment operator =
* \param other
* \return
*/
CMatrixBase &operator =(const CMatrixBase &other)
{
if (this == &other) return *this;
this->m_matrix = other.m_matrix;
return *this;
}
/*!
* \brief Operator *=
* \param factor

View File

@@ -203,20 +203,6 @@ public:
return !((*this) == other);
}
/*!
* \brief Assigment operator =
* \param other
* \return
*/
CVector3DBase &operator =(const CVector3DBase &other)
{
if (this == &other) return *this;
this->m_i = other.m_i;
this->m_j = other.m_j;
this->m_k = other.m_k;
return *this;
}
/*!
* \brief Operator +=
* \param other

View File

@@ -24,11 +24,6 @@ public:
*/
CAngle() : CPhysicalQuantity(0, CAngleUnit::defaultUnit()) {}
/*!
* \brief Copy constructor from base type
*/
CAngle(const CPhysicalQuantity &base) : CPhysicalQuantity(base) {}
/*!
* \brief Init by double value
* \param value

View File

@@ -17,34 +17,6 @@ namespace PhysicalQuantities
// --- Prefix ------------------------------------------------------------
// -----------------------------------------------------------------------
/*
* Constructor
*/
CMeasurementPrefix::CMeasurementPrefix(const QString &name, const QString &symbol, double factor) :
m_name(name), m_symbol(symbol), m_factor(factor)
{
}
/*
* Constructor
*/
CMeasurementPrefix::CMeasurementPrefix(const CMeasurementPrefix &other) :
m_name(other.m_name), m_symbol(other.m_symbol), m_factor(other.m_factor)
{
}
/*
* Assignment operator
*/
CMeasurementPrefix &CMeasurementPrefix::operator=(const CMeasurementPrefix &other)
{
if (this == &other) return *this;
this->m_name = other.m_name;
this->m_symbol= other.m_symbol;
this->m_factor = other.m_factor;
return *this;
}
/*
* Equal?
*/
@@ -106,21 +78,6 @@ CMeasurementUnit::CMeasurementUnit(const CMeasurementUnit &other) :
{
}
/*
* Assigment operator
*/
CMeasurementUnit &CMeasurementUnit::operator =(const CMeasurementUnit &other)
{
if (this == &other) return *this; // Same object? Yes, so skip assignment, and just return *this
this->m_name = other.m_name;
this->m_symbol = other.m_symbol;
this->m_prefix = other.m_prefix;
this->m_displayDigits = other.m_displayDigits;
this->m_epsilon = other.m_epsilon;
this->m_converter = other.m_converter;
return *this;
}
/*
* Equal operator
*/

View File

@@ -41,7 +41,8 @@ private:
* \param prefixName
* \param factor
*/
CMeasurementPrefix(const QString &name, const QString &symbol, double factor);
CMeasurementPrefix(const QString &name, const QString &symbol, double factor) :
m_name(name), m_symbol(symbol), m_factor(factor) {}
protected:
/*!
@@ -75,19 +76,6 @@ protected:
}
public:
/*!
* \brief Copy constructor
* \param other
*/
CMeasurementPrefix(const CMeasurementPrefix &other);
/*!
* \brief Assigmnet operator =
* \param other
* \return
*/
CMeasurementPrefix &operator =(const CMeasurementPrefix &other);
/*!
* \brief Equal operator ==
* \param other
@@ -439,13 +427,6 @@ protected:
*/
CMeasurementUnit(const CMeasurementUnit &other);
/*!
* \brief Assignment operator =
* \param other
* \return
*/
CMeasurementUnit &operator =(const CMeasurementUnit &other);
/*!
* \brief String for streaming operators is full name
* \return

View File

@@ -24,11 +24,6 @@ public:
*/
CFrequency() : CPhysicalQuantity(0, CFrequencyUnit::defaultUnit()) {}
/**
*\brief Copy constructor from base type
*/
CFrequency(const CPhysicalQuantity &base) : CPhysicalQuantity(base) {}
/*!
* \brief Init by double value
* \param value

View File

@@ -24,11 +24,6 @@ public:
*/
CLength() : CPhysicalQuantity(0, CLengthUnit::defaultUnit()) {}
/**
*\brief Copy constructor from base type
*/
CLength(const CPhysicalQuantity &base) : CPhysicalQuantity(base) {}
/*!
*\brief Init by double value
* \param value

View File

@@ -30,12 +30,6 @@ public:
*/
CMass(double value, const CMassUnit &unit) : CPhysicalQuantity(value, unit) {}
/*!
* \brief Copy constructor from base type
* \param base
*/
CMass(const CPhysicalQuantity &base) : CPhysicalQuantity(base) {}
/*!
* \brief Virtual destructor
*/

View File

@@ -18,14 +18,6 @@ template <class MU, class PQ> CPhysicalQuantity<MU, PQ>::CPhysicalQuantity(doubl
{
}
/*
* Copy constructor
*/
template <class MU, class PQ> CPhysicalQuantity<MU, PQ>::CPhysicalQuantity(const CPhysicalQuantity &other) :
m_value(other.m_value), m_unit(other.m_unit)
{
}
/*
* Equal operator ==
*/
@@ -44,18 +36,6 @@ template <class MU, class PQ> bool CPhysicalQuantity<MU, PQ>::operator !=(const
return !((*this) == other);
}
/*
* Assignment operator =
*/
template <class MU, class PQ> CPhysicalQuantity<MU, PQ>& CPhysicalQuantity<MU, PQ>::operator=(const CPhysicalQuantity<MU, PQ> &other)
{
if (this == &other) return *this;
this->m_value = other.m_value;
this->m_unit = other.m_unit;
return *this;
}
/*
* Plus operator
*/

View File

@@ -61,19 +61,6 @@ protected:
*/
CPhysicalQuantity(double value, const MU &unit);
/*!
* \brief Copy constructor
* \param other
*/
CPhysicalQuantity(const CPhysicalQuantity &other);
/*!
* \brief Assignment operator =
* \param other
* \return
*/
CPhysicalQuantity &operator =(const CPhysicalQuantity &other);
/*!
* \brief Name as string
* \param i18n

View File

@@ -25,11 +25,6 @@ public:
*/
CPressure() : CPhysicalQuantity(0, CPressureUnit::defaultUnit()) {}
/**
*\brief Copy constructor from base type
*/
CPressure(const CPhysicalQuantity &base) : CPhysicalQuantity(base) {}
/*!
*\brief Init by double value
* \param value

View File

@@ -25,11 +25,6 @@ public:
*/
CSpeed() : CPhysicalQuantity(0, CSpeedUnit::defaultUnit()) {}
/*!
*\brief Copy constructor from base type
*/
CSpeed(const CPhysicalQuantity &base): CPhysicalQuantity(base) {}
/*!
*\brief Init by double value
* \param value

View File

@@ -24,11 +24,6 @@ public:
*/
CTemperature() : CPhysicalQuantity(0, CTemperatureUnit::defaultUnit()) {}
/**
* \brief Copy constructor from base type
*/
CTemperature(const CPhysicalQuantity &base) : CPhysicalQuantity(base) {}
/*!
* \brief Init by double value
* \param value

View File

@@ -25,11 +25,6 @@ public:
*/
CTime() : CPhysicalQuantity(0, CTimeUnit::defaultUnit()) {}
/**
*\brief Copy constructor from base type
*/
CTime(const CPhysicalQuantity &base): CPhysicalQuantity(base) {}
/*!
*\brief Init by double value
* \param value

View File

@@ -166,14 +166,6 @@ protected:
* \param argument
*/
virtual void unmarshallFromDbus(const QDBusArgument &) = 0;
/*!
* \brief Copy assignment operator.
* \remark This is protected in order to forbid slicing an instance of one derived
* class into an instance of a completely unrelated derived class.
* \return
*/
CStreamable& operator=(const CStreamable&) { return *this; }
};
} // namespace