Fix copy constructor and assignment operator for SpeciesThermo classes

This commit is contained in:
Ray Speth 2014-11-08 00:53:36 +00:00
parent 926b78cc7d
commit 4bcbe862a9
6 changed files with 8 additions and 16 deletions

View file

@ -69,6 +69,7 @@ public:
* @param right Object to be copied
*/
SimpleThermo(const SimpleThermo& right) :
SpeciesThermo(right),
ID(SIMPLE),
m_tlow_max(0.0),
m_thigh_min(1.e30),
@ -92,6 +93,7 @@ public:
return *this;
}
SpeciesThermo::operator=(right);
m_loc = right.m_loc;
m_index = right.m_index;
m_tlow_max = right.m_tlow_max;

View file

@ -161,22 +161,6 @@ public:
//! Destructor
virtual ~SpeciesThermo() {}
//! Copy Constructor for the %SpeciesThermo object.
/*!
* @param right Reference to %SpeciesThermo object to be copied into the
* current one.
*/
SpeciesThermo(const SpeciesThermo& right) {}
//! Assignment operator for the %SpeciesThermo object
/*!
* @param right Reference to %SpeciesThermo object to be copied into the
* current one.
*/
SpeciesThermo& operator=(const SpeciesThermo& right) {
return *this;
}
//! Duplication routine for objects derived from SpeciesThermo
/*!
* This function can be used to duplicate objects derived from

View file

@ -144,6 +144,7 @@ SpeciesThermoDuo<T1, T2>::operator=(const SpeciesThermoDuo& right)
return *this;
}
SpeciesThermo::operator=(right);
m_thermo1 = right.m_thermo1;
m_thermo2 = right.m_thermo2;
m_p0 = right.m_p0;

View file

@ -20,6 +20,7 @@ GeneralSpeciesThermo::GeneralSpeciesThermo() :
}
GeneralSpeciesThermo::GeneralSpeciesThermo(const GeneralSpeciesThermo& b) :
SpeciesThermo(b),
m_tpoly(b.m_tpoly),
m_tlow_max(b.m_tlow_max),
m_thigh_min(b.m_thigh_min),
@ -43,6 +44,8 @@ GeneralSpeciesThermo::operator=(const GeneralSpeciesThermo& b)
if (&b == this) {
return *this;
}
SpeciesThermo::operator=(b);
clear();
// Copy SpeciesThermoInterpType objects from 'b'
for (STIT_map::const_iterator iter = b.m_sp.begin();

View file

@ -39,6 +39,7 @@ NasaThermo& NasaThermo::operator=(const NasaThermo& right)
return *this;
}
SpeciesThermo::operator=(right);
m_high = right.m_high;
m_low = right.m_low;
m_index = right.m_index;

View file

@ -101,6 +101,7 @@ public:
return *this;
}
SpeciesThermo::operator=(right);
m_high = right.m_high;
m_low = right.m_low;
m_index = right.m_index;