all classes inherit from PHRQ_base, except

NameDouble, StorageBinListItem.

NumKeyword inherits from PHRQ_base, others inherit NumKeyword.

ChartHandler and ChartObject inherit from PHRQ_base.

CurveObject does not inherit from PHRQ_base.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@5637 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2011-09-20 20:05:43 +00:00
parent f6ed50af7e
commit 7eeeab4569
60 changed files with 358 additions and 289 deletions

View File

@ -20,7 +20,9 @@ extern int error_msg(const char *err_str, const int stop, ...);
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
ChartHandler::ChartHandler()
ChartHandler::ChartHandler(PHRQ_io *io)
:
PHRQ_base(io)
//
// default constructor for ChartHandler
//
@ -78,7 +80,7 @@ ChartHandler::Read(PHREEQC_PTR_ARG_COMMA CParser &parser)
std::map<int, ChartObject *>::iterator it = this->chart_map.find(n_user);
if (it == this->chart_map.end())
{
chart_map[n_user] = new ChartObject();
chart_map[n_user] = new ChartObject(this->Get_io());
it = this->chart_map.find(n_user);
#ifdef PHREEQC_CLASS
it->second->Set_phreeqc(P_INSTANCE);

View File

@ -6,12 +6,13 @@
#include <string>
#include "Parser.h"
#include "ChartObject.h"
#include "PHRQ_base.h"
class ChartHandler
class ChartHandler: public PHRQ_base
{
public:
ChartHandler();
ChartHandler(PHRQ_io *io = NULL);
~ChartHandler();
size_t Get_chart_count()

View File

@ -33,10 +33,12 @@ using namespace zdg_ui2;
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
ChartObject::ChartObject()
ChartObject::ChartObject(PHRQ_io *io)
//
// default constructor for cxxExchComp
//
:
cxxNumKeyword(io)
{
new_ug = false;
FirstCallToUSER_GRAPH = true;
@ -478,7 +480,7 @@ ChartObject::OpenCSVFile(std::string file_name)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(P_INSTANCE_COMMA f_csv, oss_out, oss_err);
CParser parser(P_INSTANCE_COMMA f_csv, oss_out, oss_err, this->Get_io());
parser.set_echo_file(CParser::EO_NONE);
/* Get lines */

View File

@ -20,8 +20,8 @@ class ChartObject:public cxxNumKeyword
{
public:
ChartObject();
ChartObject(int i);
ChartObject(PHRQ_io *io=NULL);
ChartObject(int i, PHRQ_io *io=NULL);
~ChartObject();
// new_ug

View File

@ -27,10 +27,11 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxExchComp::cxxExchComp()
cxxExchComp::cxxExchComp(PHRQ_io *io)
//
// default constructor for cxxExchComp
//
: PHRQ_base(io)
{
moles = 0.0;
formula_totals.type = cxxNameDouble::ND_ELT_MOLES;
@ -43,11 +44,12 @@ cxxExchComp::cxxExchComp()
formula_z = 0.0;
}
cxxExchComp::cxxExchComp(struct exch_comp * exch_comp_ptr)
cxxExchComp::cxxExchComp(struct exch_comp * exch_comp_ptr, PHRQ_io *io)
//
// constructor for cxxExchComp from struct exch_comp
//
:
PHRQ_base(io),
formula_totals(exch_comp_ptr->formula_totals), totals(exch_comp_ptr->totals)
{
this->set_formula(exch_comp_ptr->formula);

View File

@ -9,12 +9,12 @@
#include "NameDouble.h"
class cxxExchComp
class cxxExchComp: public PHRQ_base
{
public:
cxxExchComp();
cxxExchComp(struct exch_comp *);
cxxExchComp(PHRQ_io *io=NULL);
cxxExchComp(struct exch_comp *, PHRQ_io *io=NULL);
~cxxExchComp();
struct master *get_master(PHREEQC_PTR_ARG);

View File

@ -29,8 +29,7 @@ cxxExchange::cxxExchange(PHRQ_io *io)
//
// default constructor for cxxExchange
//
: cxxNumKeyword(),
PHRQ_base(io)
: cxxNumKeyword(io)
{
pitzer_exchange_gammas = true;
}
@ -40,8 +39,7 @@ cxxExchange::cxxExchange(struct exchange * exchange_ptr, PHRQ_io *io)
// constructor for cxxExchange from struct exchange
//
:
cxxNumKeyword(),
PHRQ_base(io)
cxxNumKeyword(io)
{
int i;
@ -51,7 +49,7 @@ PHRQ_base(io)
pitzer_exchange_gammas = (exchange_ptr->pitzer_exchange_gammas == TRUE);
for (i = 0; i < exchange_ptr->count_comps; i++)
{
cxxExchComp ec(&(exchange_ptr->comps[i]));
cxxExchComp ec(&(exchange_ptr->comps[i]), this->Get_io());
std::string str(ec.get_formula());
exchComps[str] = ec;
}
@ -62,8 +60,7 @@ PHRQ_base(io)
}
cxxExchange::cxxExchange(PHREEQC_PTR_ARG_COMMA const std::map < int, cxxExchange > &entities,
cxxMix & mix, int l_n_user, PHRQ_io *io):
cxxNumKeyword(),
PHRQ_base(io)
cxxNumKeyword(io)
{
this->n_user = this->n_user_end = l_n_user;
this->pitzer_exchange_gammas = true;
@ -103,8 +100,7 @@ cxxExchange::cxxExchange(PHREEQC_PTR_ARG_COMMA int l_n_user, PHRQ_io *io)
// bool pitzer_exchange_gammas;
// cxxNameDouble totals;
:
cxxNumKeyword(),
PHRQ_base(io)
cxxNumKeyword(io)
{
int i;
@ -118,7 +114,7 @@ PHRQ_base(io)
{
if (P_INSTANCE_POINTER x[i]->type == EXCH)
{
cxxExchComp ec;
cxxExchComp ec(this->Get_io());
//char * formula;
ec.set_formula(P_INSTANCE_POINTER x[i]->exch_comp->formula);
//double moles;
@ -363,7 +359,7 @@ cxxExchange::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
break;
case 1: // component
{
cxxExchComp ec;
cxxExchComp ec(this->Get_io());
// preliminary read
#ifdef SKIP
@ -396,7 +392,7 @@ cxxExchange::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
ec.read_raw(P_INSTANCE_COMMA parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is);
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
if (this->exchComps.find(ec.get_formula()) != this->exchComps.end())
@ -406,7 +402,7 @@ cxxExchange::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
else
{
cxxExchComp ec1;
cxxExchComp ec1(this->Get_io());
ec1.read_raw(P_INSTANCE_COMMA reread, false);
std::string str(ec1.get_formula());
this->exchComps[str] = ec1;

View File

@ -11,15 +11,15 @@
#include "PHRQ_base.h"
class cxxMix;
class cxxExchange:public cxxNumKeyword, PHRQ_base
class cxxExchange:public cxxNumKeyword
{
public:
cxxExchange(PHRQ_io *io=NULL);
cxxExchange(PHREEQC_PTR_ARG_COMMA int n_user, PHRQ_io *io);
cxxExchange(struct exchange *, PHRQ_io *io);
cxxExchange(PHREEQC_PTR_ARG_COMMA int n_user, PHRQ_io *io=NULL);
cxxExchange(struct exchange *, PHRQ_io *io=NULL);
cxxExchange(PHREEQC_PTR_ARG_COMMA const std::map < int, cxxExchange > &exchange_map,
cxxMix & mx, int n_user, PHRQ_io *io);
cxxMix & mx, int n_user, PHRQ_io *io=NULL);
~cxxExchange();
struct exchange *cxxExchange2exchange(PHREEQC_PTR_ARG);

View File

@ -26,23 +26,23 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxGasPhase::cxxGasPhase()
cxxGasPhase::cxxGasPhase(PHRQ_io * io)
//
// default constructor for cxxGasPhase
//
: cxxNumKeyword()
: cxxNumKeyword(io)
{
total_p = 0;
volume = 0;
gasPhaseComps.type = cxxNameDouble::ND_NAME_COEF;
}
cxxGasPhase::cxxGasPhase(struct gas_phase *gas_phase_ptr)
cxxGasPhase::cxxGasPhase(struct gas_phase *gas_phase_ptr, PHRQ_io * io)
//
// constructor for cxxGasPhase from struct gas_phase
//
:
cxxNumKeyword()
cxxNumKeyword(io)
{
int i;
@ -70,8 +70,8 @@ cxxNumKeyword()
}
}
cxxGasPhase::cxxGasPhase(PHREEQC_PTR_ARG_COMMA const std::map < int, cxxGasPhase > &entities,
cxxMix & mix, int l_n_user):
cxxNumKeyword()
cxxMix & mix, int l_n_user, PHRQ_io * io):
cxxNumKeyword(io)
{
this->n_user = this->n_user_end = l_n_user;
gasPhaseComps.type = cxxNameDouble::ND_NAME_COEF;

View File

@ -15,10 +15,10 @@ class cxxGasPhase:public cxxNumKeyword
{
public:
cxxGasPhase();
cxxGasPhase(struct gas_phase *);
cxxGasPhase(PHRQ_io * io=NULL);
cxxGasPhase(struct gas_phase *, PHRQ_io * io=NULL);
cxxGasPhase(PHREEQC_PTR_ARG_COMMA const std::map < int, cxxGasPhase > &entity_map,
cxxMix & mx, int n_user);
cxxMix & mx, int n_user, PHRQ_io * io=NULL);
~cxxGasPhase();
enum GP_TYPE

View File

@ -50,7 +50,7 @@ cxxSolution(solution_ptr, io)
// totals
for (int i = 0; solution_ptr->totals[i].description != NULL; i++)
{
cxxISolutionComp c(&(solution_ptr->totals[i]));
cxxISolutionComp c(&(solution_ptr->totals[i]), this->Get_io());
//comps.insert(solution_ptr->totals[i].description, c);
comps[solution_ptr->totals[i].description] = c;
}

View File

@ -19,8 +19,8 @@ class cxxISolution:public cxxSolution
{
public:
cxxISolution(PHRQ_io *io);
cxxISolution(PHREEQC_PTR_ARG_COMMA struct solution *, PHRQ_io *io);
cxxISolution(PHRQ_io *io=NULL);
cxxISolution(PHREEQC_PTR_ARG_COMMA struct solution *, PHRQ_io *io=NULL);
//cxxISolution(const cxxISolution&);
~cxxISolution();

View File

@ -15,14 +15,21 @@
#include "phqalloc.h"
#include "output.h"
cxxISolutionComp::cxxISolutionComp(void):description(NULL), moles(0.0), input_conc(0.0), units(NULL),
equation_name(NULL), phase_si(0.0), n_pe(-1), as(NULL),
cxxISolutionComp::cxxISolutionComp(PHRQ_io *io):
PHRQ_base(io),
description(NULL),
moles(0.0),
input_conc(0.0),
units(NULL),
equation_name(NULL),
phase_si(0.0),
n_pe(-1),
as(NULL),
gfw(0.0)
//, skip(0);
//, phase(NULL)
{
}
cxxISolutionComp::cxxISolutionComp(struct conc *conc_ptr)
cxxISolutionComp::cxxISolutionComp(struct conc *conc_ptr, PHRQ_io *io)
: PHRQ_base(io)
{
this->set_description(conc_ptr->description);
moles = conc_ptr->moles;

View File

@ -9,12 +9,12 @@
// forward declarations
class cxxISolution; // reqd for read and dump_xml
class cxxISolutionComp
class cxxISolutionComp: public PHRQ_base
{
public:
cxxISolutionComp(void);
cxxISolutionComp(struct conc *conc_ptr);
~cxxISolutionComp(void);
cxxISolutionComp(PHRQ_io *io=NULL);
cxxISolutionComp(struct conc *conc_ptr, PHRQ_io *io=NULL);
~cxxISolutionComp(void);
public:

View File

@ -24,7 +24,9 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxKineticsComp::cxxKineticsComp()
cxxKineticsComp::cxxKineticsComp(PHRQ_io *io)
:
PHRQ_base(io)
//
// default constructor for cxxKineticsComp
//
@ -36,11 +38,12 @@ cxxKineticsComp::cxxKineticsComp()
namecoef.type = cxxNameDouble::ND_NAME_COEF;
}
cxxKineticsComp::cxxKineticsComp(struct kinetics_comp *kinetics_comp_ptr)
cxxKineticsComp::cxxKineticsComp(struct kinetics_comp *kinetics_comp_ptr, PHRQ_io *io)
//
// constructor for cxxKineticsComp from struct kinetics_comp
//
:
PHRQ_base(io),
namecoef(kinetics_comp_ptr->list, kinetics_comp_ptr->count_list)
{
this->set_rate_name(kinetics_comp_ptr->rate_name);

View File

@ -9,12 +9,12 @@
#include "NameDouble.h"
class cxxKineticsComp
class cxxKineticsComp: public PHRQ_base
{
public:
cxxKineticsComp();
cxxKineticsComp(struct kinetics_comp *);
cxxKineticsComp(PHRQ_io *io=NULL);
cxxKineticsComp(struct kinetics_comp *, PHRQ_io *io=NULL);
~cxxKineticsComp();
static struct kinetics_comp *cxxKineticsComp2kinetics_comp(PHREEQC_PTR_ARG_COMMA std::list < cxxKineticsComp > &el);

View File

@ -12,10 +12,11 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxNumKeyword::cxxNumKeyword()
cxxNumKeyword::cxxNumKeyword(PHRQ_io *io)
{
this->n_user = 1;
this->n_user_end = 1;
this->Set_io(io);
}
cxxNumKeyword::~cxxNumKeyword()

View File

@ -4,14 +4,15 @@
//#include "Parser.h"
#include <ostream> // std::ostream
#include <string> // std::string
#include "PHRQ_base.h"
class CParser;
//extern char *string_duplicate(const char *);
class cxxNumKeyword
class cxxNumKeyword: public PHRQ_base
{
public:
cxxNumKeyword();
cxxNumKeyword(PHRQ_io *io=NULL);
virtual ~ cxxNumKeyword();
const std::string &get_description() const
{

View File

@ -23,21 +23,21 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxPPassemblage::cxxPPassemblage()
cxxPPassemblage::cxxPPassemblage(PHRQ_io * io)
//
// default constructor for cxxPPassemblage
//
: cxxNumKeyword()
: cxxNumKeyword(io)
{
eltList.type = cxxNameDouble::ND_ELT_MOLES;
}
cxxPPassemblage::cxxPPassemblage(struct pp_assemblage *pp_assemblage_ptr)
cxxPPassemblage::cxxPPassemblage(struct pp_assemblage *pp_assemblage_ptr, PHRQ_io * io)
//
// constructor for cxxPPassemblage from struct PPassemblage
//
:
cxxNumKeyword(),
cxxNumKeyword(io),
eltList(pp_assemblage_ptr->next_elt)
{
int i;
@ -47,7 +47,7 @@ eltList(pp_assemblage_ptr->next_elt)
n_user_end = pp_assemblage_ptr->n_user_end;
for (i = 0; i < pp_assemblage_ptr->count_comps; i++)
{
cxxPPassemblageComp ppComp(&(pp_assemblage_ptr->pure_phases[i]));
cxxPPassemblageComp ppComp(&(pp_assemblage_ptr->pure_phases[i]), this->Get_io());
//ppAssemblageComps.push_back(ppComp);
std::string str(ppComp.get_name());
this->ppAssemblageComps[str] = ppComp;
@ -55,8 +55,8 @@ eltList(pp_assemblage_ptr->next_elt)
}
cxxPPassemblage::cxxPPassemblage(PHREEQC_PTR_ARG_COMMA const std::map < int,
cxxPPassemblage > &entities, cxxMix & mix,
int l_n_user):
cxxNumKeyword()
int l_n_user, PHRQ_io * io):
cxxNumKeyword(io)
{
this->n_user = this->n_user_end = l_n_user;
eltList.type = cxxNameDouble::ND_ELT_MOLES;
@ -234,7 +234,7 @@ cxxPPassemblage::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
case 1: // component
{
cxxPPassemblageComp ec;
cxxPPassemblageComp ec(this->Get_io());
// preliminary read
#ifdef SKIP
@ -268,7 +268,7 @@ cxxPPassemblage::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
ec.read_raw(parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is);
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
if (this->ppAssemblageComps.find(ec.get_name()) != this->ppAssemblageComps.end())
@ -278,7 +278,7 @@ cxxPPassemblage::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
else
{
cxxPPassemblageComp ppComp1;
cxxPPassemblageComp ppComp1(this->Get_io());
ppComp1.read_raw(reread, false);
std::string str(ppComp1.get_name());
this->ppAssemblageComps[str] = ppComp1;

View File

@ -15,10 +15,10 @@ class cxxPPassemblage:public cxxNumKeyword
{
public:
cxxPPassemblage();
cxxPPassemblage(struct pp_assemblage *);
cxxPPassemblage(PHRQ_io * io=NULL);
cxxPPassemblage(struct pp_assemblage *, PHRQ_io * io=NULL);
cxxPPassemblage(PHREEQC_PTR_ARG_COMMA const std::map < int, cxxPPassemblage > &entity_map,
cxxMix & mx, int n_user);
cxxMix & mx, int n_user, PHRQ_io * io=NULL);
~cxxPPassemblage();
struct pp_assemblage *cxxPPassemblage2pp_assemblage(PHREEQC_PTR_ARG);

View File

@ -25,7 +25,9 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxPPassemblageComp::cxxPPassemblageComp()
cxxPPassemblageComp::cxxPPassemblageComp(PHRQ_io *io)
:
PHRQ_base(io)
//
// default constructor for cxxPPassemblageComp
//
@ -39,7 +41,9 @@ cxxPPassemblageComp::cxxPPassemblageComp()
precipitate_only = false;
}
cxxPPassemblageComp::cxxPPassemblageComp(struct pure_phase * pure_phase_ptr)
cxxPPassemblageComp::cxxPPassemblageComp(struct pure_phase * pure_phase_ptr, PHRQ_io *io)
:
PHRQ_base(io)
//
// constructor for cxxPPassemblageComp from struct pure_phase
//

View File

@ -9,12 +9,12 @@
#include "NameDouble.h"
class cxxPPassemblageComp
class cxxPPassemblageComp: public PHRQ_base
{
public:
cxxPPassemblageComp();
cxxPPassemblageComp(struct pure_phase *);
cxxPPassemblageComp(PHRQ_io *io=NULL);
cxxPPassemblageComp(struct pure_phase *, PHRQ_io *io=NULL);
~cxxPPassemblageComp();

View File

@ -24,7 +24,11 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CParser::CParser(PHREEQC_PTR_ARG_COMMA std::istream & input):m_input_stream(input), m_output_stream(std::cout), m_error_stream(std::cerr),
CParser::CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, PHRQ_io *io):
PHRQ_base(io),
m_input_stream(input),
m_output_stream(std::cout),
m_error_stream(std::cerr),
m_input_error(0),
m_next_keyword(KT_NONE)
{
@ -38,7 +42,12 @@ m_next_keyword(KT_NONE)
#endif
}
CParser::CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, std::ostream & output):m_input_stream(input), m_output_stream(output), m_error_stream(std::cerr),
CParser::CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, std::ostream & output, PHRQ_io *io)
:
PHRQ_base(io),
m_input_stream(input),
m_output_stream(output),
m_error_stream(std::cerr),
m_input_error(0),
m_next_keyword(KT_NONE)
{
@ -52,7 +61,12 @@ m_next_keyword(KT_NONE)
#endif
}
CParser::CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, std::ostream & output, std::ostream & error):m_input_stream(input), m_output_stream(output), m_error_stream(error),
CParser::CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, std::ostream & output, std::ostream & error, PHRQ_io *io)
:
PHRQ_base(io),
m_input_stream(input),
m_output_stream(output),
m_error_stream(error),
m_input_error(0),
m_next_keyword(KT_NONE)
{

View File

@ -19,14 +19,15 @@ class Phreeqc;
#define ERROR_MESSAGE_QUALIFIER ::
extern int input_error;
#endif
#include "PHRQ_base.h"
class CParser
class CParser: public PHRQ_base
{
public:
CParser(PHREEQC_PTR_ARG_COMMA std::istream & input);
CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, std::ostream & output);
CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, PHRQ_io *io=NULL);
CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, std::ostream & output, PHRQ_io *io=NULL);
CParser(PHREEQC_PTR_ARG_COMMA std::istream & input, std::ostream & output,
std::ostream & error);
std::ostream & error, PHRQ_io *io=NULL);
virtual ~ CParser();

View File

@ -470,7 +470,7 @@ size_t Phreeqc::list_components(std::list<std::string> &list_c)
// pure phases
for (i = 0; i < count_pp_assemblage; i++)
{
cxxPPassemblage entity(&pp_assemblage[i]);
cxxPPassemblage entity(&pp_assemblage[i], &this->phrq_io);
entity.totalize(this);
accumulator.add_extensive(entity.get_totals(), 1.0);
}
@ -486,7 +486,7 @@ size_t Phreeqc::list_components(std::list<std::string> &list_c)
// surfaces
for (i = 0; i < count_surface; i++)
{
cxxSurface entity(&surface[i]);
cxxSurface entity(&surface[i], &this->phrq_io);
entity.totalize();
accumulator.add_extensive(entity.get_totals(), 1.0);
}
@ -494,7 +494,7 @@ size_t Phreeqc::list_components(std::list<std::string> &list_c)
// gas phases
for (i = 0; i < count_gas_phase; i++)
{
cxxGasPhase entity(&gas_phase[i]);
cxxGasPhase entity(&gas_phase[i], &this->phrq_io);
entity.totalize(this);
accumulator.add_extensive(entity.get_totals(), 1.0);
}
@ -1185,6 +1185,9 @@ void Phreeqc::init(void)
count_strings = 0;
chart_handler.Set_io(&this->phrq_io);
run_info.Set_io(&this->phrq_io);
this->clear_cookie();
return;

View File

@ -22,11 +22,11 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxReaction::cxxReaction()
cxxReaction::cxxReaction(PHRQ_io *io)
//
// default constructor for cxxReaction
//
: cxxNumKeyword()
: cxxNumKeyword(io)
{
this->set_units("Mol");
countSteps = 0;
@ -34,13 +34,12 @@ cxxReaction::cxxReaction()
reactantList.type = cxxNameDouble::ND_NAME_COEF;
elementList.type = cxxNameDouble::ND_ELT_MOLES;
}
cxxReaction::cxxReaction(struct irrev *irrev_ptr)
cxxReaction::cxxReaction(struct irrev *irrev_ptr, PHRQ_io *io)
//
// constructor for cxxReaction from struct irrev
//
:
cxxNumKeyword(),
cxxNumKeyword(io),
reactantList(irrev_ptr->list, irrev_ptr->count_list),
elementList(irrev_ptr->elts)
{

View File

@ -14,8 +14,8 @@ class cxxReaction:public cxxNumKeyword
{
public:
cxxReaction();
cxxReaction(struct irrev *);
cxxReaction(PHRQ_io *io = NULL);
cxxReaction(struct irrev *, PHRQ_io *io = NULL);
~cxxReaction();
struct irrev *cxxReaction2irrev(PHREEQC_PTR_ARG);

View File

@ -94,7 +94,7 @@ read_solution_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -187,7 +187,7 @@ read_exchange_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -281,7 +281,7 @@ read_surface_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -296,7 +296,7 @@ read_surface_raw(void)
std::istream::pos_type next_char;
parser.get_option(vopts, next_char);
cxxSurface ex;
cxxSurface ex(&this->phrq_io);
ex.read_raw(PHREEQC_THIS_COMMA parser);
struct surface *surface_ptr = ex.cxxSurface2surface(PHREEQC_THIS);
int n;
@ -376,7 +376,7 @@ read_equilibrium_phases_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -391,7 +391,7 @@ read_equilibrium_phases_raw(void)
std::istream::pos_type next_char;
parser.get_option(vopts, next_char);
cxxPPassemblage ex;
cxxPPassemblage ex(&this->phrq_io);
ex.read_raw(PHREEQC_THIS_COMMA parser);
struct pp_assemblage *pp_assemblage_ptr = ex.cxxPPassemblage2pp_assemblage(PHREEQC_THIS);
int n;
@ -472,7 +472,7 @@ read_kinetics_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -567,7 +567,7 @@ read_solid_solutions_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -664,7 +664,7 @@ read_gas_phase_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -679,7 +679,7 @@ read_gas_phase_raw(void)
std::istream::pos_type next_char;
parser.get_option(vopts, next_char);
cxxGasPhase ex;
cxxGasPhase ex(&this->phrq_io);
ex.read_raw(PHREEQC_THIS_COMMA parser);
struct gas_phase *gas_phase_ptr = ex.cxxGasPhase2gas_phase(PHREEQC_THIS);
int n;
@ -758,7 +758,7 @@ read_reaction_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -853,7 +853,7 @@ read_mix_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
{
@ -948,7 +948,7 @@ read_temperature_raw(void)
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
if (pr.echo_input == FALSE)
@ -964,7 +964,7 @@ read_temperature_raw(void)
std::istream::pos_type next_char;
parser.get_option(vopts, next_char);
cxxTemperature ex;
cxxTemperature ex(&this->phrq_io);
ex.read_raw(parser);
struct temperature *temperature_ptr = ex.cxxTemperature2temperature(PHREEQC_THIS);
int n;
@ -1025,7 +1025,7 @@ read_dump(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1043,7 +1043,7 @@ read_dump(void)
parser.set_echo_file(CParser::EO_NOKEYWORDS);
}
dumper dmp(parser);
dumper dmp(parser, &this->phrq_io);
dump_info = dmp;
@ -1077,7 +1077,7 @@ read_delete(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1095,7 +1095,7 @@ read_delete(void)
parser.set_echo_file(CParser::EO_NOKEYWORDS);
}
StorageBinList deleter(parser);
StorageBinList deleter(parser, &this->phrq_io);
delete_info = deleter;
@ -1129,7 +1129,7 @@ read_run_cells(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1147,7 +1147,7 @@ read_run_cells(void)
parser.set_echo_file(CParser::EO_NOKEYWORDS);
}
runner r(parser);
runner r(parser, &this->phrq_io);
run_info = r;
@ -1292,7 +1292,7 @@ read_solution_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1390,7 +1390,7 @@ read_equilibrium_phases_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1417,7 +1417,7 @@ read_equilibrium_phases_modify(void)
}
// read entity
cxxPPassemblage entity(&(pp_assemblage[n]));
cxxPPassemblage entity(&(pp_assemblage[n]), &this->phrq_io);
entity.read_raw(PHREEQC_THIS_COMMA parser, false);
// save entity
@ -1483,7 +1483,7 @@ read_exchange_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1591,7 +1591,7 @@ read_surface_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1618,7 +1618,7 @@ read_surface_modify(void)
}
// read entity
cxxSurface entity(&(surface[n]));
cxxSurface entity(&(surface[n]), &this->phrq_io);
entity.read_raw(PHREEQC_THIS_COMMA parser, false);
// save entity
@ -1680,7 +1680,7 @@ read_solid_solutions_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1768,7 +1768,7 @@ read_gas_phase_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1795,7 +1795,7 @@ read_gas_phase_modify(void)
}
// read entity
cxxGasPhase entity(&(gas_phase[n]));
cxxGasPhase entity(&(gas_phase[n]), &this->phrq_io);
entity.read_raw(PHREEQC_THIS_COMMA parser, false);
// save entity
struct gas_phase *entity_ptr = entity.cxxGasPhase2gas_phase(PHREEQC_THIS);
@ -1856,7 +1856,7 @@ read_kinetics_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out; // ??
std::ostringstream oss_err; // ??
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -1944,7 +1944,7 @@ read_reaction_modify(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
assert(!reading_database());
//For testing, need to read line to get started
@ -2705,7 +2705,7 @@ dump_ostream(std::ostream& os)
{
for (i = 0; i < count_pp_assemblage; i++)
{
cxxPPassemblage cxxentity(&pp_assemblage[i]);
cxxPPassemblage cxxentity(&pp_assemblage[i], &this->phrq_io);
cxxentity.dump_raw(os,0);
}
}
@ -2717,7 +2717,7 @@ dump_ostream(std::ostream& os)
if (pp_assemblage_bsearch(*it, &n) != NULL)
{
cxxPPassemblage cxxentity(&pp_assemblage[n]);
cxxPPassemblage cxxentity(&pp_assemblage[n], &this->phrq_io);
cxxentity.dump_raw(os,0);
}
}
@ -2757,7 +2757,7 @@ dump_ostream(std::ostream& os)
{
for (i = 0; i < count_surface; i++)
{
cxxSurface cxxentity(&surface[i]);
cxxSurface cxxentity(&surface[i], &this->phrq_io);
cxxentity.dump_raw(os,0);
}
}
@ -2769,7 +2769,7 @@ dump_ostream(std::ostream& os)
if (surface_bsearch(*it, &n) != NULL)
{
cxxSurface cxxentity(&surface[n]);
cxxSurface cxxentity(&surface[n], &this->phrq_io);
cxxentity.dump_raw(os,0);
}
}
@ -2809,7 +2809,7 @@ dump_ostream(std::ostream& os)
{
for (i = 0; i < count_gas_phase; i++)
{
cxxGasPhase cxxentity(&gas_phase[i]);
cxxGasPhase cxxentity(&gas_phase[i], &this->phrq_io);
cxxentity.dump_raw(os,0);
}
}
@ -2821,7 +2821,7 @@ dump_ostream(std::ostream& os)
if (gas_phase_bsearch(*it, &n) != NULL)
{
cxxGasPhase cxxentity(&gas_phase[n]);
cxxGasPhase cxxentity(&gas_phase[n], &this->phrq_io);
cxxentity.dump_raw(os,0);
}
}
@ -2913,7 +2913,7 @@ dump_ostream(std::ostream& os)
{
for (i = 0; i < count_temperature; i++)
{
cxxTemperature cxxentity(&temperature[i]);
cxxTemperature cxxentity(&temperature[i], &this->phrq_io);
cxxentity.dump_raw(os,0);
}
}
@ -2925,7 +2925,7 @@ dump_ostream(std::ostream& os)
if (temperature_bsearch(*it, &n) != NULL)
{
cxxTemperature cxxentity(&temperature[n]);
cxxTemperature cxxentity(&temperature[n], &this->phrq_io);
cxxentity.dump_raw(os,0);
}
}
@ -2968,7 +2968,7 @@ read_user_graph_handler(void)
return_value = streamify_to_next_keyword(iss_in);
std::ostringstream oss_out;
std::ostringstream oss_err;
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err);
CParser parser(PHREEQC_THIS_COMMA iss_in, oss_out, oss_err, &this->phrq_io);
//For testing, need to read line to get started
std::vector < std::string > vopts;

View File

@ -25,20 +25,20 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxSSassemblage::cxxSSassemblage()
cxxSSassemblage::cxxSSassemblage(PHRQ_io * io)
//
// default constructor for cxxSSassemblage
//
: cxxNumKeyword()
: cxxNumKeyword(io)
{
}
cxxSSassemblage::cxxSSassemblage(struct s_s_assemblage * s_s_assemblage_ptr)
cxxSSassemblage::cxxSSassemblage(struct s_s_assemblage * s_s_assemblage_ptr, PHRQ_io * io)
//
// constructor for cxxSSassemblage from struct SSassemblage
//
:
cxxNumKeyword()
cxxNumKeyword(io)
{
int i;
this->set_description(s_s_assemblage_ptr->description);
@ -46,15 +46,15 @@ cxxNumKeyword()
n_user_end = s_s_assemblage_ptr->n_user_end;
for (i = 0; i < s_s_assemblage_ptr->count_s_s; i++)
{
cxxSSassemblageSS ssSS(&(s_s_assemblage_ptr->s_s[i]));
cxxSSassemblageSS ssSS(&(s_s_assemblage_ptr->s_s[i]), this->Get_io());
std::string str(ssSS.get_name());
ssAssemblageSSs[str] = ssSS;
}
}
cxxSSassemblage::cxxSSassemblage(const std::map < int,
cxxSSassemblage > &entities, cxxMix & mix,
int l_n_user):
cxxNumKeyword()
int l_n_user, PHRQ_io * io):
cxxNumKeyword(io)
{
this->n_user = this->n_user_end = l_n_user;
//std::list<cxxSSassemblageSS> ssAssemblageSSs;
@ -211,7 +211,7 @@ cxxSSassemblage::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
case 0: // solid_solution
{
cxxSSassemblageSS ec;
cxxSSassemblageSS ec(this->Get_io());
// preliminary read
#ifdef SKIP
@ -243,7 +243,7 @@ cxxSSassemblage::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
ec.read_raw(P_INSTANCE_COMMA parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is);
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
if (this->ssAssemblageSSs.find(ec.get_name()) != this->ssAssemblageSSs.end())
@ -253,7 +253,7 @@ cxxSSassemblage::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
else
{
cxxSSassemblageSS ec1;
cxxSSassemblageSS ec1(this->Get_io());
ec1.read_raw(P_INSTANCE_COMMA reread, false);
std::string str(ec1.get_name());
this->ssAssemblageSSs[str] = ec1;

View File

@ -20,10 +20,10 @@ class cxxSSassemblage:public cxxNumKeyword
{
public:
cxxSSassemblage();
cxxSSassemblage(struct s_s_assemblage *);
cxxSSassemblage(PHRQ_io * io = NULL);
cxxSSassemblage(struct s_s_assemblage *, PHRQ_io * io = NULL);
cxxSSassemblage(const std::map < int, cxxSSassemblage > &entity_map,
cxxMix & mx, int n_user);
cxxMix & mx, int n_user, PHRQ_io * io = NULL);
~cxxSSassemblage();
struct s_s_assemblage *cxxSSassemblage2s_s_assemblage(PHREEQC_PTR_ARG);

View File

@ -25,7 +25,9 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxSSassemblageSS::cxxSSassemblageSS()
cxxSSassemblageSS::cxxSSassemblageSS(PHRQ_io *io)
:
PHRQ_base(io)
//
// default constructor for cxxSSassemblageSS
//
@ -44,8 +46,9 @@ cxxSSassemblageSS::cxxSSassemblageSS()
//double p[4];
}
cxxSSassemblageSS::cxxSSassemblageSS(struct s_s *s_s_ptr)
//
cxxSSassemblageSS::cxxSSassemblageSS(struct s_s *s_s_ptr, PHRQ_io *io)
:
PHRQ_base(io) //
// constructor for cxxSSassemblageSS from struct s_s
//
{

View File

@ -10,12 +10,12 @@
#include "NameDouble.h"
#include "Phreeqc_class.h"
class cxxSSassemblageSS
class cxxSSassemblageSS: public PHRQ_base
{
public:
cxxSSassemblageSS();
cxxSSassemblageSS(struct s_s *);
cxxSSassemblageSS(PHRQ_io *io=NULL);
cxxSSassemblageSS(struct s_s *, PHRQ_io *io=NULL);
~cxxSSassemblageSS();
enum SS_PARAMETER_TYPE

View File

@ -36,8 +36,8 @@ cxxSolution::cxxSolution(PHRQ_io * io)
//
// default constructor for cxxSolution
//
: cxxNumKeyword(),
PHRQ_base(io)
: cxxNumKeyword(io),
isotopes(io)
{
this->tc = 25.0;
this->ph = 7.0;
@ -59,14 +59,13 @@ cxxSolution::cxxSolution(struct solution * solution_ptr, PHRQ_io * io)
// constructor for cxxSolution from struct solution
//
:
cxxNumKeyword(),
PHRQ_base(io),
cxxNumKeyword(io),
totals(solution_ptr->totals),
master_activity(solution_ptr->master_activity,
solution_ptr->count_master_activity,
cxxNameDouble::ND_SPECIES_LA),
species_gamma(solution_ptr->species_gamma, solution_ptr->count_species_gamma,
cxxNameDouble::ND_SPECIES_GAMMA), isotopes(solution_ptr)
solution_ptr->count_master_activity,
cxxNameDouble::ND_SPECIES_LA),
species_gamma(solution_ptr->species_gamma, solution_ptr->count_species_gamma, cxxNameDouble::ND_SPECIES_GAMMA),
isotopes(solution_ptr, io)
{
this->set_description(solution_ptr->description);
@ -103,8 +102,8 @@ cxxSolution::cxxSolution(PHREEQC_PTR_ARG_COMMA const std::map < int, cxxSolution
// constructor for cxxSolution from mixture of solutions
//
:
cxxNumKeyword(),
PHRQ_base(io)
cxxNumKeyword(io),
isotopes(io)
{
//
@ -142,8 +141,8 @@ cxxSolution::cxxSolution(PHREEQC_PTR_ARG_COMMA int l_n_user, PHRQ_io * io)
// does not work in phast because phast uses only the total molalities
// of elements in buffer, not individual redox states.
:
cxxNumKeyword(),
PHRQ_base(io)
cxxNumKeyword(io),
isotopes(io)
{
//this->set_description none;
@ -256,7 +255,7 @@ PHRQ_base(io)
{
for (i = 0; i < P_INSTANCE_POINTER count_isotopes_x; i++)
{
cxxSolutionIsotope cxxiso;
cxxSolutionIsotope cxxiso(this->Get_io());
cxxiso.set_isotope_number(P_INSTANCE_POINTER isotopes_x[i].isotope_number);
cxxiso.set_elt_name(P_INSTANCE_POINTER isotopes_x[i].elt_name);
cxxiso.set_isotope_name(P_INSTANCE_POINTER isotopes_x[i].isotope_name);
@ -687,7 +686,7 @@ cxxSolution::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
case 3: // isotopes
{
cxxSolutionIsotope iso;
cxxSolutionIsotope iso(this->Get_io());
if (iso.read_raw(parser, next_char) != CParser::PARSER_OK)
{
parser.incr_input_error();

View File

@ -13,15 +13,15 @@
#include "PHRQ_io.h"
class cxxMix;
class cxxSolution:public cxxNumKeyword, public PHRQ_base
class cxxSolution:public cxxNumKeyword
{
public:
cxxSolution(PHRQ_io *io=NULL);
cxxSolution(struct solution *, PHRQ_io *io);
cxxSolution(PHREEQC_PTR_ARG_COMMA int n_user, PHRQ_io *io);
cxxSolution(struct solution *, PHRQ_io *io=NULL);
cxxSolution(PHREEQC_PTR_ARG_COMMA int n_user, PHRQ_io *io=NULL);
cxxSolution(PHREEQC_PTR_ARG_COMMA const std::map < int, cxxSolution > &solution_map,
cxxMix & mx, int n_user, PHRQ_io *io);
cxxMix & mx, int n_user, PHRQ_io *io=NULL);
~cxxSolution();
//static cxxSolution& read(CParser& parser);

View File

@ -15,7 +15,9 @@
#include "phqalloc.h"
#include "phrqproto.h"
cxxSolutionIsotope::cxxSolutionIsotope(void):
cxxSolutionIsotope::cxxSolutionIsotope(PHRQ_io *io)
:
PHRQ_base(io),
isotope_number(0.0)
{
isotope_number = 0;
@ -27,7 +29,9 @@ isotope_number(0.0)
ratio_uncertainty_defined = false;
}
cxxSolutionIsotope::cxxSolutionIsotope(struct isotope *isotope_ptr)
cxxSolutionIsotope::cxxSolutionIsotope(struct isotope *isotope_ptr, PHRQ_io *io)
:
PHRQ_base(io)
{
isotope_number = isotope_ptr->isotope_number;
this->set_elt_name(isotope_ptr->elt_name);

View File

@ -7,12 +7,12 @@
#include "Parser.h"
#include "Phreeqc_class.h"
class cxxSolutionIsotope
class cxxSolutionIsotope: public PHRQ_base
{
public:
cxxSolutionIsotope(void);
cxxSolutionIsotope(struct isotope *isotope_ptr);
~cxxSolutionIsotope(void);
cxxSolutionIsotope(PHRQ_io *io=NULL);
cxxSolutionIsotope(struct isotope *isotope_ptr, PHRQ_io *io=NULL);
~cxxSolutionIsotope(void);
/*
enum STATUS {

View File

@ -13,30 +13,34 @@
#include "phrqproto.h"
cxxSolutionIsotopeList::cxxSolutionIsotopeList(void)
cxxSolutionIsotopeList::cxxSolutionIsotopeList(PHRQ_io * io)
:
PHRQ_base(io)
//
// default constructor for cxxSolution
//
{
}
cxxSolutionIsotopeList::~cxxSolutionIsotopeList(void)
//
// default destructor for cxxSolution
//
{
}
cxxSolutionIsotopeList::cxxSolutionIsotopeList(struct solution *solution_ptr)
cxxSolutionIsotopeList::cxxSolutionIsotopeList(struct solution *solution_ptr, PHRQ_io * io)
:
PHRQ_base(io)
{
int i;
// Isotopes
for (i = 0; i < solution_ptr->count_isotopes; i++)
{
//cxxSolutionIsotope iso(&solution_ptr->isotopes[i]);
(*this).push_back(&solution_ptr->isotopes[i]);
cxxSolutionIsotope iso(&solution_ptr->isotopes[i], this->Get_io());
(*this).push_back(iso);
}
}
cxxSolutionIsotopeList::~cxxSolutionIsotopeList()
//
// default destructor for cxxSolution
//
{
}
void
cxxSolutionIsotopeList::add(cxxSolutionIsotopeList old, double intensive,
double extensive)
@ -66,7 +70,7 @@ cxxSolutionIsotopeList::add(cxxSolutionIsotopeList old, double intensive,
}
if (!found)
{
cxxSolutionIsotope iso;
cxxSolutionIsotope iso(this->Get_io());
iso.total = itold->total * extensive;
iso.ratio = itold->ratio * intensive;
iso.ratio_uncertainty = itold->ratio_uncertainty * intensive;

View File

@ -9,13 +9,13 @@
#include "Phreeqc_class.h"
class cxxSolutionIsotopeList:public
std::list < cxxSolutionIsotope >
std::list < cxxSolutionIsotope >, public PHRQ_base
{
public:
cxxSolutionIsotopeList();
cxxSolutionIsotopeList(PHRQ_io *io=NULL);
cxxSolutionIsotopeList(struct solution *solution_ptr);
cxxSolutionIsotopeList(struct solution *solution_ptr, PHRQ_io *io=NULL);
~cxxSolutionIsotopeList();

View File

@ -46,6 +46,7 @@ cxxStorageBin::cxxStorageBin(PHRQ_io *io)
PHRQ_base(io)
{
// default constructor for cxxStorageBin
this->system.Set_io(io);
}
#ifdef SKIP
cxxStorageBin::cxxStorageBin(struct Use *use_ptr)
@ -123,6 +124,7 @@ PHRQ_base(io)
//Construct from use pointer
int n;
this->system.Set_io(io);
if (use_ptr->mix_in == TRUE)
{
struct mix *struct_entity = P_INSTANCE_POINTER mix_bsearch(use_ptr->n_mix_user, &n);
@ -158,7 +160,7 @@ PHRQ_base(io)
struct pp_assemblage *struct_entity = P_INSTANCE_POINTER pp_assemblage_bsearch(use_ptr->n_pp_assemblage_user, &n);
if (struct_entity != NULL)
{
cxxPPassemblage entity(struct_entity);
cxxPPassemblage entity(struct_entity, this->Get_io());
this->setPPassemblage(use_ptr->n_pp_assemblage_user, &entity);
}
}
@ -176,7 +178,7 @@ PHRQ_base(io)
struct surface *struct_entity = P_INSTANCE_POINTER surface_bsearch(use_ptr->n_surface_user, &n);
if (struct_entity != NULL)
{
cxxSurface entity(struct_entity);
cxxSurface entity(struct_entity, this->Get_io());
this->setSurface(use_ptr->n_surface_user, &entity);
}
}
@ -185,7 +187,7 @@ PHRQ_base(io)
struct gas_phase *struct_entity = P_INSTANCE_POINTER gas_phase_bsearch(use_ptr->n_gas_phase_user, &n);
if (struct_entity != NULL)
{
cxxGasPhase entity(struct_entity);
cxxGasPhase entity(struct_entity, this->Get_io());
this->setGasPhase(use_ptr->n_gas_phase_user, &entity);
}
}
@ -221,7 +223,7 @@ PHRQ_base(io)
struct temperature *struct_entity = P_INSTANCE_POINTER temperature_bsearch(use_ptr->n_temperature_user, &n);
if (struct_entity != NULL)
{
cxxTemperature entity(struct_entity);
cxxTemperature entity(struct_entity, this->Get_io());
this->setTemperature(use_ptr->n_temperature_user, &entity);
}
}
@ -523,7 +525,7 @@ cxxStorageBin::import_phreeqc(PHREEQC_PTR_ARG)
// GasPhases
for (i = 0; i < P_INSTANCE_POINTER count_gas_phase; i++)
{
GasPhases[P_INSTANCE_POINTER gas_phase[i].n_user] = cxxGasPhase(&P_INSTANCE_POINTER gas_phase[i]);
GasPhases[P_INSTANCE_POINTER gas_phase[i].n_user] = cxxGasPhase(&P_INSTANCE_POINTER gas_phase[i], this->Get_io());
}
// Kinetics
@ -536,7 +538,7 @@ cxxStorageBin::import_phreeqc(PHREEQC_PTR_ARG)
for (i = 0; i < P_INSTANCE_POINTER count_pp_assemblage; i++)
{
PPassemblages[P_INSTANCE_POINTER pp_assemblage[i].n_user] =
cxxPPassemblage(&P_INSTANCE_POINTER pp_assemblage[i]);
cxxPPassemblage(&P_INSTANCE_POINTER pp_assemblage[i], this->Get_io());
}
// SSassemblages
@ -549,7 +551,7 @@ cxxStorageBin::import_phreeqc(PHREEQC_PTR_ARG)
// Surfaces
for (i = 0; i < P_INSTANCE_POINTER count_surface; i++)
{
Surfaces[P_INSTANCE_POINTER surface[i].n_user] = cxxSurface(&P_INSTANCE_POINTER surface[i]);
Surfaces[P_INSTANCE_POINTER surface[i].n_user] = cxxSurface(&P_INSTANCE_POINTER surface[i], this->Get_io());
}
// Mixes
@ -567,7 +569,7 @@ cxxStorageBin::import_phreeqc(PHREEQC_PTR_ARG)
// Temperatures
for (i = 0; i < P_INSTANCE_POINTER count_temperature; i++)
{
Temperatures[P_INSTANCE_POINTER temperature[i].n_user] = cxxTemperature(&P_INSTANCE_POINTER temperature[i]);
Temperatures[P_INSTANCE_POINTER temperature[i].n_user] = cxxTemperature(&P_INSTANCE_POINTER temperature[i], this->Get_io());
}
}
@ -748,7 +750,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_GASPHASE_RAW:
{
cxxGasPhase entity;
cxxGasPhase entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
GasPhases[entity.get_n_user()] = entity;
}
@ -764,7 +766,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_PPASSEMBLAGE_RAW:
{
cxxPPassemblage entity;
cxxPPassemblage entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
PPassemblages[entity.get_n_user()] = entity;
}
@ -780,7 +782,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_SURFACE_RAW:
{
cxxSurface entity;
cxxSurface entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
Surfaces[entity.get_n_user()] = entity;
}
@ -788,7 +790,7 @@ cxxStorageBin::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_TEMPERATURE_RAW:
{
cxxTemperature entity;
cxxTemperature entity(this->Get_io());
entity.read_raw(parser);
Temperatures[entity.get_n_user()] = entity;
}
@ -861,7 +863,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_GASPHASE_RAW:
{
cxxGasPhase entity;
cxxGasPhase entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
GasPhases[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
@ -879,7 +881,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_PPASSEMBLAGE_RAW:
{
cxxPPassemblage entity;
cxxPPassemblage entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
PPassemblages[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
@ -897,7 +899,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_SURFACE_RAW:
{
cxxSurface entity;
cxxSurface entity(this->Get_io());
entity.read_raw(P_INSTANCE_COMMA parser);
Surfaces[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
@ -906,7 +908,7 @@ cxxStorageBin::read_raw_keyword(PHREEQC_PTR_ARG_COMMA CParser & parser)
case CParser::KT_TEMPERATURE_RAW:
{
cxxTemperature entity;
cxxTemperature entity(this->Get_io());
entity.read_raw(parser);
Temperatures[entity.get_n_user()] = entity;
entity_number = entity.get_n_user();
@ -953,7 +955,7 @@ cxxStorageBin::add(struct system *system_ptr)
if (system_ptr->gas_phase != NULL)
{
this->GasPhases[system_ptr->gas_phase->n_user] =
cxxGasPhase(system_ptr->gas_phase);
cxxGasPhase(system_ptr->gas_phase, this->Get_io());
}
// Kinetics
@ -967,7 +969,7 @@ cxxStorageBin::add(struct system *system_ptr)
if (system_ptr->pp_assemblage != NULL)
{
this->PPassemblages[system_ptr->pp_assemblage->n_user] =
cxxPPassemblage(system_ptr->pp_assemblage);
cxxPPassemblage(system_ptr->pp_assemblage, this->Get_io());
}
// SSassemblages
@ -981,7 +983,7 @@ cxxStorageBin::add(struct system *system_ptr)
if (system_ptr->surface != NULL)
{
this->Surfaces[system_ptr->surface->n_user] =
cxxSurface(system_ptr->surface);
cxxSurface(system_ptr->surface, this->Get_io());
}
}
@ -1126,7 +1128,7 @@ cxxStorageBin::phreeqc2cxxStorageBin(PHREEQC_PTR_ARG_COMMA int n)
{
if (P_INSTANCE_POINTER gas_phase_bsearch(n, &pos) != NULL)
{
this->GasPhases[n] = cxxGasPhase(&(P_INSTANCE_POINTER gas_phase[pos]));
this->GasPhases[n] = cxxGasPhase(&(P_INSTANCE_POINTER gas_phase[pos]), this->Get_io());
}
}
@ -1142,7 +1144,7 @@ cxxStorageBin::phreeqc2cxxStorageBin(PHREEQC_PTR_ARG_COMMA int n)
{
if (P_INSTANCE_POINTER pp_assemblage_bsearch(n, &pos) != NULL)
{
this->PPassemblages[n] = cxxPPassemblage(&(P_INSTANCE_POINTER pp_assemblage[pos]));
this->PPassemblages[n] = cxxPPassemblage(&(P_INSTANCE_POINTER pp_assemblage[pos]), this->Get_io());
}
}
@ -1158,7 +1160,7 @@ cxxStorageBin::phreeqc2cxxStorageBin(PHREEQC_PTR_ARG_COMMA int n)
{
if (P_INSTANCE_POINTER surface_bsearch(n, &pos) != NULL)
{
this->Surfaces[n] = cxxSurface(&(P_INSTANCE_POINTER surface[pos]));
this->Surfaces[n] = cxxSurface(&(P_INSTANCE_POINTER surface[pos]), this->Get_io());
}
}
}

View File

@ -23,9 +23,9 @@ class cxxStorageBin: public PHRQ_base
{
public:
cxxStorageBin(PHRQ_io *io);
cxxStorageBin(PHRQ_io *io=NULL);
//cxxStorageBin(struct Use *use_ptr);
cxxStorageBin(PHREEQC_PTR_ARG_COMMA struct Use *use_ptr, PHRQ_io *io);
cxxStorageBin(PHREEQC_PTR_ARG_COMMA struct Use *use_ptr, PHRQ_io *io=NULL);
~cxxStorageBin();
void import_phreeqc(PHREEQC_PTR_ARG);

View File

@ -97,10 +97,17 @@ void StorageBinListItem::Augment(int i)
this->defined = true;
this->numbers.insert(i);
}
StorageBinList::StorageBinList(void)
//
//Class definitions for StorageBinList
//
StorageBinList::StorageBinList(PHRQ_io *io)
:
PHRQ_base(io)
{
}
StorageBinList::StorageBinList(CParser & parser)
StorageBinList::StorageBinList(CParser & parser, PHRQ_io *io)
:
PHRQ_base(io)
{
this->Read(parser);
}

View File

@ -4,7 +4,7 @@
#include <string> // std::string
#include <list> // std::list
#include <vector> // std::vector
#include "PHRQ_base.h"
class CParser;
class StorageBinListItem
@ -23,11 +23,11 @@ protected:
std::set < int > numbers;
bool defined;
};
class StorageBinList
class StorageBinList: public PHRQ_base
{
public:
StorageBinList(void);
StorageBinList(CParser & parser);
StorageBinList(PHRQ_io *io=NULL);
StorageBinList(CParser & parser, PHRQ_io *io=NULL);
~StorageBinList(void);
bool Read(CParser & parser);
void SetAll(bool tf);

View File

@ -23,11 +23,11 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxSurface::cxxSurface()
cxxSurface::cxxSurface(PHRQ_io *io)
//
// default constructor for cxxSurface
//
: cxxNumKeyword()
: cxxNumKeyword(io)
{
type = DDL;
dl_type = NO_DL;
@ -43,12 +43,12 @@ cxxSurface::cxxSurface()
transport = false;
}
cxxSurface::cxxSurface(struct surface *surface_ptr)
cxxSurface::cxxSurface(struct surface *surface_ptr, PHRQ_io *io)
//
// constructor for cxxSurface from struct surface
//
:
cxxNumKeyword()
cxxNumKeyword(io)
{
int i;
@ -70,21 +70,21 @@ cxxNumKeyword()
// Surface components
for (i = 0; i < surface_ptr->count_comps; i++)
{
cxxSurfaceComp ec(&(surface_ptr->comps[i]));
cxxSurfaceComp ec(&(surface_ptr->comps[i]), this->Get_io());
std::string str(ec.get_formula());
surfaceComps[str] = ec;
}
// Surface charge
for (i = 0; i < surface_ptr->count_charge; i++)
{
cxxSurfaceCharge ec(&(surface_ptr->charge[i]));
cxxSurfaceCharge ec(&(surface_ptr->charge[i]), this->Get_io());
std::string str(ec.get_name());
surfaceCharges[str] = ec;
}
}
cxxSurface::cxxSurface(PHREEQC_PTR_ARG_COMMA const std::map < int, cxxSurface > &entities,
cxxMix & mix, int l_n_user):
cxxNumKeyword()
cxxMix & mix, int l_n_user, PHRQ_io *io):
cxxNumKeyword(io)
{
this->n_user = this->n_user_end = l_n_user;
type = DDL;
@ -510,7 +510,7 @@ cxxSurface::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
case 5: // component
{
cxxSurfaceComp ec;
cxxSurfaceComp ec(this->Get_io());
// preliminary read
#ifdef SKIP
@ -542,7 +542,7 @@ cxxSurface::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
ec.read_raw(P_INSTANCE_COMMA parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is);
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
if (this->surfaceComps.find(ec.get_formula()) != this->surfaceComps.end())
@ -552,7 +552,7 @@ cxxSurface::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
else
{
cxxSurfaceComp ec1;
cxxSurfaceComp ec1(this->Get_io());
ec1.read_raw(P_INSTANCE_COMMA reread, false);
std::string str(ec1.get_formula());
this->surfaceComps[str] = ec1;
@ -563,7 +563,7 @@ cxxSurface::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
case 6: // charge_component
{
cxxSurfaceCharge ec;
cxxSurfaceCharge ec(this->Get_io());
// preliminary read
#ifdef SKIP
@ -595,7 +595,7 @@ cxxSurface::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
ec.read_raw(P_INSTANCE_COMMA parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is);
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
if (this->surfaceCharges.find(ec.get_name()) != this->surfaceCharges.end())
@ -605,7 +605,7 @@ cxxSurface::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
else
{
cxxSurfaceCharge ec1;
cxxSurfaceCharge ec1(this->Get_io());
ec1.read_raw(P_INSTANCE_COMMA reread, false);
std::string str(ec1.get_name());
this->surfaceCharges[str] = ec1;

View File

@ -16,10 +16,10 @@ class cxxSurface:public cxxNumKeyword
{
public:
cxxSurface();
cxxSurface(struct surface *);
cxxSurface(PHRQ_io *io=NULL);
cxxSurface(struct surface *, PHRQ_io *io=NULL);
cxxSurface(PHREEQC_PTR_ARG_COMMA const std::map < int, cxxSurface > &entity_map, cxxMix & mx,
int n_user);
int n_user, PHRQ_io *io=NULL);
~cxxSurface();
//enum SURFACE_STYPE { UNKNOWN_DL, NO_EDL, DDL, CD_MUSIC };

View File

@ -24,7 +24,9 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxSurfaceCharge::cxxSurfaceCharge()
cxxSurfaceCharge::cxxSurfaceCharge(PHRQ_io *io)
:
PHRQ_base(io)
//
// default constructor for cxxSurfaceCharge
//
@ -41,11 +43,12 @@ cxxSurfaceCharge::cxxSurfaceCharge()
diffuse_layer_totals.type = cxxNameDouble::ND_ELT_MOLES;
}
cxxSurfaceCharge::cxxSurfaceCharge(struct surface_charge *surf_charge_ptr)
cxxSurfaceCharge::cxxSurfaceCharge(struct surface_charge *surf_charge_ptr, PHRQ_io *io)
//
// constructor for cxxSurfaceCharge from struct surface_charge
//
:
PHRQ_base(io),
diffuse_layer_totals(surf_charge_ptr->diffuse_layer_totals)
{
this->set_name(surf_charge_ptr->name);

View File

@ -9,14 +9,15 @@
#include "NameDouble.h"
#include "Phreeqc_class.h"
#include "PHRQ_base.h"
class cxxSurfaceCharge
class cxxSurfaceCharge: public PHRQ_base
{
public:
cxxSurfaceCharge();
cxxSurfaceCharge(struct surface_charge *);
cxxSurfaceCharge(PHRQ_io *io=NULL);
cxxSurfaceCharge(struct surface_charge *, PHRQ_io *io=NULL);
~cxxSurfaceCharge();

View File

@ -24,7 +24,9 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxSurfaceComp::cxxSurfaceComp()
cxxSurfaceComp::cxxSurfaceComp(PHRQ_io *io)
:
PHRQ_base(io)
//
// default constructor for cxxSurfaceComp
//
@ -40,11 +42,12 @@ cxxSurfaceComp::cxxSurfaceComp()
Dw = 0.0;
}
cxxSurfaceComp::cxxSurfaceComp(struct surface_comp *surf_comp_ptr)
cxxSurfaceComp::cxxSurfaceComp(struct surface_comp *surf_comp_ptr, PHRQ_io *io)
//
// constructor for cxxSurfaceComp from struct surface_comp
//
:
PHRQ_base(io),
formula_totals(surf_comp_ptr->formula_totals),
totals(surf_comp_ptr->totals)
{

View File

@ -9,13 +9,13 @@
#include "Phreeqc_class.h"
#include "NameDouble.h"
class cxxSurfaceComp
class cxxSurfaceComp: public PHRQ_base
{
public:
cxxSurfaceComp();
cxxSurfaceComp(struct surface_comp *);
cxxSurfaceComp(PHRQ_io *io=NULL);
cxxSurfaceComp(struct surface_comp *, PHRQ_io *io=NULL);
~cxxSurfaceComp();
struct master *get_master(PHREEQC_PTR_ARG);

View File

@ -22,7 +22,9 @@
extern void ORCH_write_chemistry_species(std::ostream & chemistry_dat);
cxxSystem::cxxSystem(void)
cxxSystem::cxxSystem(PHRQ_io *io)
:
PHRQ_base(io)
{
this->solution = NULL;
this->exchange = NULL;

View File

@ -11,6 +11,7 @@
//#include "Reaction.h"
//#include "Temperature.h"
#include "NameDouble.h"
#include "PHRQ_base.h"
class cxxSolution;
class cxxExchange;
class cxxGasPhase;
@ -22,10 +23,10 @@ class cxxReaction;
class cxxTemperature;
class cxxMix;
class cxxSystem
class cxxSystem: public PHRQ_base
{
public:
cxxSystem(void);
cxxSystem(PHRQ_io *io=NULL);
~cxxSystem(void);
void Initialize(void);
void setSolution(cxxSolution * entity)

View File

@ -24,22 +24,22 @@
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
cxxTemperature::cxxTemperature()
cxxTemperature::cxxTemperature(PHRQ_io *io)
//
// default constructor for cxxTemperature
//
: cxxNumKeyword()
: cxxNumKeyword(io)
{
countTemps = 0;
equalIncrements = false;
}
cxxTemperature::cxxTemperature(struct temperature *temperature_ptr)
cxxTemperature::cxxTemperature(struct temperature *temperature_ptr, PHRQ_io *io)
//
// constructor for cxxTemperature from struct temperature
//
:
cxxNumKeyword()
cxxNumKeyword(io)
{
int i;

View File

@ -14,9 +14,9 @@ class cxxTemperature:public cxxNumKeyword
{
public:
cxxTemperature();
cxxTemperature(struct temperature *);
~cxxTemperature();
cxxTemperature(PHRQ_io *io=NULL);
cxxTemperature(struct temperature *, PHRQ_io *io=NULL);
~cxxTemperature();
struct temperature *cxxTemperature2temperature(PHREEQC_PTR_ARG);

View File

@ -31,8 +31,7 @@ cxxKinetics::cxxKinetics(PHRQ_io *io)
//
// default constructor for cxxKinetics
//
: cxxNumKeyword(),
PHRQ_base(io)
: cxxNumKeyword(io)
{
step_divide = 1.0;
rk = 3;
@ -49,8 +48,7 @@ cxxKinetics::cxxKinetics(struct kinetics *kinetics_ptr, PHRQ_io *io)
// constructor for cxxKinetics from struct kinetics
//
:
cxxNumKeyword(),
PHRQ_base(io),
cxxNumKeyword(io),
totals(kinetics_ptr->totals)
{
int i;
@ -68,7 +66,7 @@ totals(kinetics_ptr->totals)
// kinetics components
for (i = 0; i < kinetics_ptr->count_comps; i++)
{
cxxKineticsComp ec(&(kinetics_ptr->comps[i]));
cxxKineticsComp ec(&(kinetics_ptr->comps[i]), this->Get_io());
std::string str(ec.get_rate_name());
//this->kineticsComps[str] = ec;
this->kineticsComps.push_back(ec);
@ -89,8 +87,7 @@ totals(kinetics_ptr->totals)
}
cxxKinetics::cxxKinetics(const std::map < int, cxxKinetics > &entities,
cxxMix & mix, int l_n_user, PHRQ_io *io):
cxxNumKeyword(),
PHRQ_base(io)
cxxNumKeyword(io)
{
this->n_user = this->n_user_end = l_n_user;
step_divide = 1.0;
@ -411,7 +408,7 @@ cxxKinetics::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
case 4: // component
{
cxxKineticsComp ec;
cxxKineticsComp ec(this->Get_io());
// preliminary read
#ifdef SKIP
@ -443,7 +440,7 @@ cxxKinetics::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
ec.read_raw(P_INSTANCE_COMMA parser, false);
parser.set_accumulate(false);
std::istringstream is(parser.get_accumulated());
CParser reread(P_INSTANCE_COMMA is);
CParser reread(P_INSTANCE_COMMA is, this->Get_io());
reread.set_echo_file(CParser::EO_NONE);
reread.set_echo_stream(CParser::EO_NONE);
@ -463,7 +460,7 @@ cxxKinetics::read_raw(PHREEQC_PTR_ARG_COMMA CParser & parser, bool check)
}
else
{
cxxKineticsComp ec1;
cxxKineticsComp ec1(this->Get_io());
ec1.read_raw(P_INSTANCE_COMMA reread, false);
std::string str(ec1.get_rate_name());
this->kineticsComps.push_back(ec1);

View File

@ -12,14 +12,14 @@
#include "PHRQ_base.h"
class cxxMix;
class cxxKinetics:public cxxNumKeyword, PHRQ_base
class cxxKinetics:public cxxNumKeyword
{
public:
cxxKinetics(PHRQ_io *io = NULL);
cxxKinetics(struct kinetics *, PHRQ_io *io);
cxxKinetics(PHRQ_io *io=NULL);
cxxKinetics(struct kinetics *, PHRQ_io *io=NULL);
cxxKinetics(const std::map < int, cxxKinetics > &entity_map, cxxMix & mx,
int n_user, PHRQ_io *io);
int n_user, PHRQ_io *io=NULL);
~cxxKinetics();
struct kinetics *cxxKinetics2kinetics(PHREEQC_PTR_ARG);

View File

@ -28,8 +28,7 @@ cxxMix::cxxMix(PHRQ_io *io)
//
// default constructor for cxxMix
//
: cxxNumKeyword(),
PHRQ_base(io)
: cxxNumKeyword(io)
{
}
@ -38,8 +37,7 @@ cxxMix::cxxMix(struct mix *mix_ptr, PHRQ_io *io)
// constructor for cxxMix from struct mix
//
:
cxxNumKeyword(),
PHRQ_base(io)
cxxNumKeyword(io)
{
int i;

View File

@ -10,12 +10,12 @@
#include "NumKeyword.h"
#include "PHRQ_base.h"
class cxxMix:public cxxNumKeyword, PHRQ_base
class cxxMix:public cxxNumKeyword
{
public:
cxxMix(PHRQ_io *io=NULL);
cxxMix(struct mix *, PHRQ_io *io);
cxxMix(struct mix *, PHRQ_io *io=NULL);
~cxxMix();
struct mix *cxxMix2mix(PHREEQC_PTR_ARG);

View File

@ -3,13 +3,17 @@
#include "dumper.h"
#include "Parser.h"
dumper::dumper(void)
dumper::dumper(PHRQ_io *io)
:
PHRQ_base(io)
{
this->file_name = "dump.out";
this->append = false;
this->on = false;
}
dumper::dumper(CParser & parser)
dumper::dumper(CParser & parser, PHRQ_io *io)
:
PHRQ_base(io)
{
this->file_name = "dump.out";
this->append = false;

View File

@ -7,11 +7,11 @@
#include "StorageBinList.h"
class CParser;
class dumper
class dumper: public PHRQ_base
{
public:
dumper(void);
dumper(CParser & parser);
dumper(PHRQ_io *io=NULL);
dumper(CParser & parser, PHRQ_io *io=NULL);
~dumper(void);
bool Read(CParser & parser);
void SetAll(bool tf);

View File

@ -1,14 +1,18 @@
#include "runner.h"
#include "Parser.h"
#include "NA.h"
runner::runner(void)
runner::runner(PHRQ_io *io)
:
PHRQ_base(io)
{
this->time_step = NA;
this->start_time = NA;
this->run_cells = false;
}
runner::runner(CParser & parser)
runner::runner(CParser & parser, PHRQ_io *io)
:
PHRQ_base(io)
{
this->time_step = NA;
this->start_time = NA;

View File

@ -4,13 +4,14 @@
#include <string> // std::string
#include "StorageBinList.h"
#include "PHRQ_base.h"
class CParser;
class runner
class runner: public PHRQ_base
{
public:
runner(void);
runner(CParser & parser);
runner(PHRQ_io *io=NULL);
runner(CParser & parser, PHRQ_io *io=NULL);
virtual ~runner(void);
bool Read(CParser & parser);
StorageBinListItem & Get_cells(void) { return(this->cells); };