Commit 1e59d46e authored by Volker Friese's avatar Volker Friese Committed by Florian Uhlig
Browse files

Implement move constructor and move assignment operator.

parent ba9d130b
......@@ -37,6 +37,17 @@ CbmStsParAsic::CbmStsParAsic(const CbmStsParAsic& other)
// -------------------------------------------------------------------------
// ----- Move constructor ----------------------------------------------
CbmStsParAsic::CbmStsParAsic(CbmStsParAsic&& other)
{
Set(other.fNofChannels, other.fNofAdc, other.fDynRange, other.fThreshold, other.fTimeResolution, other.fDeadTime,
other.fNoise, other.fZeroNoiseRate);
SetTimeOffset(other.fTimeOffset);
SetWalkCoef(other.fWalkCoef);
}
// -------------------------------------------------------------------------
// ----- Copy assignment operator --------------------------------------
CbmStsParAsic& CbmStsParAsic::operator=(const CbmStsParAsic& other)
{
......@@ -49,6 +60,18 @@ CbmStsParAsic& CbmStsParAsic::operator=(const CbmStsParAsic& other)
// -------------------------------------------------------------------------
// ----- Move assignment operator --------------------------------------
CbmStsParAsic& CbmStsParAsic::operator=(CbmStsParAsic&& other)
{
Set(other.fNofChannels, other.fNofAdc, other.fDynRange, other.fThreshold, other.fTimeResolution, other.fDeadTime,
other.fNoise, other.fZeroNoiseRate);
SetTimeOffset(other.fTimeOffset);
SetWalkCoef(other.fWalkCoef);
return *this;
}
// -------------------------------------------------------------------------
// ----- Destructor ----------------------------------------------------
CbmStsParAsic::~CbmStsParAsic()
{
......
......@@ -41,12 +41,12 @@ public:
double noise, double znr);
/** @brief Copy constructor (disabled) **/
/** @brief Copy constructor **/
CbmStsParAsic(const CbmStsParAsic&);
/** @brief Move constructor (disabled) **/
CbmStsParAsic(CbmStsParAsic&&) = default;
CbmStsParAsic(CbmStsParAsic&&);
/** @brief Copy assignment operator **/
......@@ -54,7 +54,7 @@ public:
/** @brief Move assignment operator (disabled) **/
CbmStsParAsic& operator=(CbmStsParAsic&&) = default;
CbmStsParAsic& operator=(CbmStsParAsic&&);
/** @brief Destructor **/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment