From 990537d5f1403244891d8d7baff001d25ab813d7 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Mon, 4 Feb 2008 00:30:31 +0000 Subject: [PATCH] Added a duplicator routine. --- Cantera/src/thermo/PDSS.cpp | 14 ++++++++++++++ Cantera/src/thermo/PDSS.h | 13 +++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Cantera/src/thermo/PDSS.cpp b/Cantera/src/thermo/PDSS.cpp index 4bddd6567..ad80d58e0 100644 --- a/Cantera/src/thermo/PDSS.cpp +++ b/Cantera/src/thermo/PDSS.cpp @@ -139,6 +139,20 @@ namespace Cantera { PDSS::~PDSS() { } + // Duplicator from the %PDSS parent class + /* + * Given a pointer to a %PDSS object, this function will + * duplicate the %PDSS object and all underlying structures. + * This is basically a wrapper around the copy constructor. + * + * @return returns a pointer to a %PDSS + */ + PDSS *PDSS::duplMyselfAsPDSS() const { + PDSS *ip = new PDSS(*this); + return ip; + } + + void PDSS::constructPDSS(ThermoPhase *tp, int spindex) { initThermo(); } diff --git a/Cantera/src/thermo/PDSS.h b/Cantera/src/thermo/PDSS.h index a266c62c9..487f75bf8 100644 --- a/Cantera/src/thermo/PDSS.h +++ b/Cantera/src/thermo/PDSS.h @@ -112,10 +112,20 @@ namespace Cantera { //! Destructor for the phase virtual ~PDSS(); + + //! Duplication routine for objects which inherit from %PDSS + /*! + * This virtual routine can be used to duplicate %PDSS objects + * inherited from %PDSS even if the application only has + * a pointer to %PDSS to work with. + * + * @return returns a pointer to the base %PDSS object type + */ + virtual PDSS *duplMyselfAsPDSS() const; /** * - * @name Utilities + * @name Utilities * @{ */ @@ -189,7 +199,6 @@ namespace Cantera { * Get the difference in the standard state thermodynamic properties * between the current pressure. and the reference pressure, p0 */ - virtual doublereal enthalpyDelp_mole() const; virtual doublereal intEnergyDelp_mole() const; virtual doublereal entropyDelp_mole() const;