From 1756f4a65ef6fc96ec866b5b88cef33e1ea38665 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Sun, 6 Dec 2009 18:01:43 +0000 Subject: [PATCH] changes in comments. --- Cantera/src/thermo/VPSSMgr.cpp | 26 +++++++++++++++++++++----- Cantera/src/thermo/VPSSMgr.h | 4 ++-- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/Cantera/src/thermo/VPSSMgr.cpp b/Cantera/src/thermo/VPSSMgr.cpp index 1f8e451d8..64ec7e22c 100644 --- a/Cantera/src/thermo/VPSSMgr.cpp +++ b/Cantera/src/thermo/VPSSMgr.cpp @@ -74,12 +74,30 @@ namespace Cantera { *this = right; } + //==================================================================================================================== + /* + * Assigment operator + * We use a shallow copy strategy here. Note, this will have to be fixed up later. + */ VPSSMgr& VPSSMgr::operator=(const VPSSMgr &right) { if (&right == this) { return *this; } m_kk = right.m_kk; + /* + * What we are doing here is to make a shallow copy of the VPStandardStateTP + * pointer in the "new" VPSSMgr object using the value from the "old" + * VPSSMgr object. This is not appropriate if we are making a copy of a ThermoPhase + * object and the VPSSMgr objects are owned by the ThermoPhase object. + * + * The new object will want to have a different value of m_vptp_ptr than the + * value this is being copied here. It will want to refer to the copy of the + * VPStandardStateTP object being made that will own the new VPSSMgr object. + * However, the assignment object is not the place to carry out this fixup. + * + * We will have to "fix" up the shallow copies later. + */ m_vptp_ptr = right.m_vptp_ptr; m_spthermo = right.m_spthermo; m_tlast = -1.0; @@ -113,13 +131,12 @@ namespace Cantera { return *this; } - + //==================================================================================================================== VPSSMgr *VPSSMgr::duplMyselfAsVPSSMgr() const { VPSSMgr *vp = new VPSSMgr(*this); return vp; } - - + //==================================================================================================================== void VPSSMgr::initAllPtrs(VPStandardStateTP *vp_ptr, SpeciesThermo *sp_ptr) { m_vptp_ptr = vp_ptr; @@ -141,8 +158,7 @@ namespace Cantera { } } - - /*****************************************************************/ + //==================================================================================================================== // Standard States void diff --git a/Cantera/src/thermo/VPSSMgr.h b/Cantera/src/thermo/VPSSMgr.h index 5be3b3217..b57751883 100644 --- a/Cantera/src/thermo/VPSSMgr.h +++ b/Cantera/src/thermo/VPSSMgr.h @@ -772,11 +772,11 @@ namespace Cantera { const XML_Node * const phaseNode_ptr); - //! Initialize the internal pointers in this object + //! Initialize the internal shallow pointers in this object /*! * There are a bunch of internal shallow pointers that point to the owning * VPStandardStateTP and SpeciesThermo objects. This function reinitializes - * them. + * them. This function is called like an onion. * * @param vp_ptr Pointer to the VPStandardStateTP standard state * @param sp_ptr Poitner to the SpeciesThermo standard state