Deprecate (previously) unused convenience wrapper classes

- Edge.h, IncompressibleSolid.h and Metal.h
This commit is contained in:
Ingmar Schoegl 2019-10-25 23:11:20 -05:00 committed by Ray Speth
parent 9f6cba3c33
commit eda3b2fbfb
3 changed files with 29 additions and 2 deletions

View file

@ -6,6 +6,8 @@
#ifndef CXX_EDGE #ifndef CXX_EDGE
#define CXX_EDGE #define CXX_EDGE
#pragma message("warning: Edge.h is deprecated and will be removed after Cantera 2.5.0.")
#include "thermo/ThermoFactory.h" #include "thermo/ThermoFactory.h"
#include "kinetics/importKinetics.h" #include "kinetics/importKinetics.h"
#include "kinetics/EdgeKinetics.h" #include "kinetics/EdgeKinetics.h"
@ -15,6 +17,10 @@ namespace Cantera
{ {
//! Convenience class which inherits from both EdgePhase and EdgeKinetics //! Convenience class which inherits from both EdgePhase and EdgeKinetics
/*!
* @deprecated To be removed after Cantera 2.5.0.
* Replaceable with Solution and/or EdgePhase/EdgeKinetics.
*/
class Edge : class Edge :
public EdgePhase, public EdgeKinetics public EdgePhase, public EdgeKinetics
{ {
@ -22,6 +28,9 @@ public:
Edge(const std::string& infile, std::string id, std::vector<ThermoPhase*> phases) Edge(const std::string& infile, std::string id, std::vector<ThermoPhase*> phases)
: m_ok(false), m_r(0) : m_ok(false), m_r(0)
{ {
warn_deprecated("class Metal",
"To be removed after Cantera 2.5.0. "
"Replaceable with Solution and/or EdgePhase/EdgeKinetics.");
m_r = get_XML_File(infile); m_r = get_XML_File(infile);
if (id == "-") { if (id == "-") {
id = ""; id = "";

View file

@ -6,6 +6,8 @@
#ifndef CXX_INCOMPRESSIBLE #ifndef CXX_INCOMPRESSIBLE
#define CXX_INCOMPRESSIBLE #define CXX_INCOMPRESSIBLE
#pragma message("warning: IncompressibleSolid.h is deprecated and will be removed after Cantera 2.5.0.")
#include "thermo/ConstDensityThermo.h" #include "thermo/ConstDensityThermo.h"
#include "kinetics/importKinetics.h" #include "kinetics/importKinetics.h"
@ -13,19 +15,26 @@ namespace Cantera
{ {
//! Wrapper for ConstDensityThermo with constructor from file //! Wrapper for ConstDensityThermo with constructor from file
/*!
* @deprecated To be removed after Cantera 2.5.0.
* Replaceable with Solution and/or LatticePhase/IdealSolidSolnPhase.
*/
class IncompressibleSolid : public ConstDensityThermo class IncompressibleSolid : public ConstDensityThermo
{ {
public: public:
IncompressibleSolid(const std::string& infile, IncompressibleSolid(const std::string& infile,
std::string id="") : m_ok(false), m_r(0) std::string id="") : m_ok(false), m_r(0)
{ {
warn_deprecated("class IncompressibleSolid",
"To be removed after Cantera 2.5.0. "
"Replaceable with Solution and/or LatticePhase/IdealSolidSolnPhase.");
m_r = get_XML_File(infile); m_r = get_XML_File(infile);
if (id == "-") { if (id == "-") {
id = ""; id = "";
} }
m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0); m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0);
if (!m_ok) throw CanteraError("IncompressibleSolid", if (!m_ok) throw CanteraError("IncompressibleSolid",
"buildSolutionFromXML returned false"); "buildSolutionFromXML returned false");
} }
bool operator!() { bool operator!() {

View file

@ -6,6 +6,8 @@
#ifndef CXX_METAL #ifndef CXX_METAL
#define CXX_METAL #define CXX_METAL
#pragma message("warning: Metal.h is deprecated and will be removed after Cantera 2.5.0.")
#include "thermo/MetalPhase.h" #include "thermo/MetalPhase.h"
#include "kinetics/importKinetics.h" #include "kinetics/importKinetics.h"
@ -13,18 +15,25 @@ namespace Cantera
{ {
//! Wrapper for MetalPhase with constructor from file //! Wrapper for MetalPhase with constructor from file
/*!
* @deprecated To be removed after Cantera 2.5.0.
* Replaceable with Solution and/or MetalPhase.
*/
class Metal : public MetalPhase class Metal : public MetalPhase
{ {
public: public:
Metal(const std::string& infile, std::string id="") : m_ok(false), m_r(0) Metal(const std::string& infile, std::string id="") : m_ok(false), m_r(0)
{ {
warn_deprecated("class Metal",
"To be removed after Cantera 2.5.0. "
"Replaceable with Solution and/or MetalPhase.");
m_r = get_XML_File(infile); m_r = get_XML_File(infile);
if (id == "-") { if (id == "-") {
id = ""; id = "";
} }
m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0); m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0);
if (!m_ok) throw CanteraError("Metal::Metal", if (!m_ok) throw CanteraError("Metal::Metal",
"buildSolutionFromXML returned false"); "buildSolutionFromXML returned false");
} }
bool operator!() { bool operator!() {