Added optional argument to dump_raw to a different user number.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/branches/ErrorHandling@5680 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2011-10-05 17:20:16 +00:00
parent fe9f31443e
commit 58c0e3f7c8
22 changed files with 51 additions and 49 deletions

View File

@ -227,7 +227,7 @@ cxxExchange::dump_xml(std::ostream & s_oss, unsigned int indent) const
}
void
cxxExchange::dump_raw(std::ostream & s_oss, unsigned int indent) const
cxxExchange::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) const
{
//const char ERR_MESSAGE[] = "Packing exchange message: %s, element not found\n";
unsigned int i;
@ -242,8 +242,8 @@ cxxExchange::dump_raw(std::ostream & s_oss, unsigned int indent) const
// Exchange element and attributes
s_oss << indent0;
s_oss << "EXCHANGE_RAW " << this->n_user << " " << this->
description << std::endl;
int n_user_local = (n_out != NULL) ? *n_out : this->n_user;
s_oss << "EXCHANGE_RAW " << n_user_local << " " << this->description << std::endl;
s_oss << indent1;
s_oss << "-exchange_gammas " << this->

View File

@ -21,7 +21,7 @@ public:
cxxMix & mx, int n_user, PHRQ_io *io=NULL);
~cxxExchange();
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out=NULL) const;
void read_raw(CParser & parser, bool check = true);

View File

@ -161,7 +161,7 @@ cxxGasPhase::dump_xml(std::ostream & s_oss, unsigned int indent) const const
#endif
void
cxxGasPhase::dump_raw(std::ostream & s_oss, unsigned int indent) const
cxxGasPhase::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) const
{
//const char ERR_MESSAGE[] = "Packing gas_phase message: %s, element not found\n";
unsigned int i;
@ -176,8 +176,8 @@ cxxGasPhase::dump_raw(std::ostream & s_oss, unsigned int indent) const
// GasPhase element and attributes
s_oss << indent0;
s_oss << "GAS_PHASE_RAW " << this->n_user << " " << this->
description << std::endl;
int n_user_local = (n_out != NULL) ? *n_out : this->n_user;
s_oss << "GAS_PHASE_RAW " << n_user_local << " " << this->description << std::endl;
s_oss << indent1;
s_oss << "-type " << this->type << std::endl;

View File

@ -30,7 +30,7 @@ class cxxGasPhase:public cxxNumKeyword
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out=NULL) const;
void read_raw(CParser & parser, bool check = true);

View File

@ -113,7 +113,7 @@ cxxPPassemblage::dump_xml(std::ostream & s_oss, unsigned int indent) const
}
void
cxxPPassemblage::dump_raw(std::ostream & s_oss, unsigned int indent) const
cxxPPassemblage::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) const
{
//const char ERR_MESSAGE[] = "Packing PPassemblage message: %s, element not found\n";
unsigned int i;
@ -128,7 +128,8 @@ cxxPPassemblage::dump_raw(std::ostream & s_oss, unsigned int indent) const
// PPassemblage element and attributes
s_oss << indent0;
s_oss << "EQUILIBRIUM_PHASES_RAW " << this->n_user << " " << this->
int n_user_local = (n_out != NULL) ? *n_out : this->n_user;
s_oss << "EQUILIBRIUM_PHASES_RAW " << n_user_local << " " << this->
description << std::endl;
// eltList

View File

@ -21,7 +21,7 @@ class cxxPPassemblage:public cxxNumKeyword
cxxMix & mx, int n_user, PHRQ_io * io=NULL);
~cxxPPassemblage();
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out=NULL) const;
void read_raw(CParser & parser, bool check = true);

View File

@ -111,7 +111,7 @@ cxxReaction::dump_xml(std::ostream & s_oss, unsigned int indent) const const
#endif
void
cxxReaction::dump_raw(std::ostream & s_oss, unsigned int indent) const
cxxReaction::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) const
{
//const char ERR_MESSAGE[] = "Packing irrev message: %s, element not found\n";
unsigned int i;
@ -126,8 +126,8 @@ cxxReaction::dump_raw(std::ostream & s_oss, unsigned int indent) const
// Reaction element and attributes
s_oss << indent0;
s_oss << "REACTION_RAW " << this->n_user << " " << this->
description << std::endl;
int n_user_local = (n_out != NULL) ? *n_out : this->n_user;
s_oss << "REACTION_RAW " << n_user_local << " " << this->description << std::endl;
s_oss << indent1;
s_oss << "-units " << this->units << std::endl;

View File

@ -20,7 +20,7 @@ class cxxReaction:public cxxNumKeyword
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out=NULL) const;
void read_raw(CParser & parser, bool check);
const cxxNameDouble &Get_elementList(void) const {return this->elementList;};

View File

@ -111,7 +111,7 @@ cxxSSassemblage::dump_xml(std::ostream & s_oss, unsigned int indent) const const
}
#endif
void
cxxSSassemblage::dump_raw(std::ostream & s_oss, unsigned int indent) const
cxxSSassemblage::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) const
{
//const char ERR_MESSAGE[] = "Packing SSassemblage message: %s, element not found\n";
unsigned int i;
@ -126,8 +126,8 @@ cxxSSassemblage::dump_raw(std::ostream & s_oss, unsigned int indent) const
// SSassemblage element and attributes
s_oss << indent0;
s_oss << "SOLID_SOLUTIONS_RAW " << this->n_user << " " << this->
description << std::endl;
int n_user_local = (n_out != NULL) ? *n_out : this->n_user;
s_oss << "SOLID_SOLUTIONS_RAW " << n_user_local << " " << this->description << std::endl;
// ssAssemblageSSs
for (std::map < std::string, cxxSSassemblageSS >::const_iterator it =

View File

@ -29,7 +29,7 @@ public:
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out=NULL) const;
void read_raw(CParser & parser, bool check = true);
const std::map <std::string, cxxSSassemblageSS > & Get_ssAssemblageSSs() const

View File

@ -396,7 +396,7 @@ cxxSolution::dump_xml(std::ostream & s_oss, unsigned int indent) const
}
void
cxxSolution::dump_raw(std::ostream & s_oss, unsigned int indent) const
cxxSolution::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) const
{
//const char ERR_MESSAGE[] = "Packing solution message: %s, element not found\n";
unsigned int i;
@ -411,8 +411,8 @@ cxxSolution::dump_raw(std::ostream & s_oss, unsigned int indent) const
// Solution element and attributes
s_oss << indent0;
s_oss << "SOLUTION_RAW " << this->n_user << " " << this->
description << std::endl;
int n_user_local = (n_out != NULL) ? *n_out : this->n_user;
s_oss << "SOLUTION_RAW " << n_user_local << " " << this->description << std::endl;
//s_oss << "# Critical values" << std::endl;

View File

@ -147,7 +147,7 @@ class cxxSolution:public cxxNumKeyword
double Get_master_activity(char *string) const;
void Set_master_activity(char *string, double value);
const cxxSolutionIsotopeList & Get_isotopes(void) const {return isotopes;};
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out=NULL) const;
void read_raw(CParser & parser, bool check = true);
void multiply(double extensive);

View File

@ -585,53 +585,53 @@ cxxStorageBin::dump_raw(std::ostream & s_oss, unsigned int indent) const
}
void
cxxStorageBin::dump_raw(std::ostream & s_oss, int n, unsigned int indent)
cxxStorageBin::dump_raw(std::ostream & s_oss, int n, unsigned int indent, int *n_out)
{
// Dump one user number
// Dump one user number, optionally change number from n to n_out
int n_user_local = (n_out != NULL) ? *n_out : n;
//const char ERR_MESSAGE[] = "Packing mix message: %s, element not found\n";
s_oss.precision(DBL_DIG - 1);
// Solutions
if (this->Get_Solution(n) != NULL)
{
this->Get_Solution(n)->dump_raw(s_oss, indent);
this->Get_Solution(n)->dump_raw(s_oss, indent, &n_user_local);
}
// Exchange
if (this->Get_Exchange(n) != NULL)
{
this->Get_Exchange(n)->dump_raw(s_oss, indent);
this->Get_Exchange(n)->dump_raw(s_oss, indent, &n_user_local);
}
// Gas Phases
if (this->Get_GasPhase(n) != NULL)
{
this->Get_GasPhase(n)->dump_raw(s_oss, indent);
this->Get_GasPhase(n)->dump_raw(s_oss, indent, &n_user_local);
}
// Kinetics
if (this->Get_Kinetics(n) != NULL)
{
this->Get_Kinetics(n)->dump_raw(s_oss, indent);
this->Get_Kinetics(n)->dump_raw(s_oss, indent, &n_user_local);
}
// PPassemblage
if (this->Get_PPassemblage(n) != NULL)
{
this->Get_PPassemblage(n)->dump_raw(s_oss, indent);
this->Get_PPassemblage(n)->dump_raw(s_oss, indent, &n_user_local);
}
// SSassemblage
if (this->Get_SSassemblage(n) != NULL)
{
this->Get_SSassemblage(n)->dump_raw(s_oss, indent);
this->Get_SSassemblage(n)->dump_raw(s_oss, indent, &n_user_local);
}
// Surface
if (this->Get_Surface(n) != NULL)
{
this->Get_Surface(n)->dump_raw(s_oss, indent);
this->Get_Surface(n)->dump_raw(s_oss, indent, &n_user_local);
}
}

View File

@ -77,7 +77,7 @@ class cxxStorageBin: public PHRQ_base
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void dump_raw(std::ostream & s_oss, int i, unsigned int indent);
void dump_raw(std::ostream & s_oss, int i, unsigned int indent, int *n_out=NULL);
void read_raw(CParser & parser);
int read_raw_keyword(CParser & parser);

View File

@ -217,7 +217,7 @@ cxxSurface::dump_xml(std::ostream & s_oss, unsigned int indent) const
}
void
cxxSurface::dump_raw(std::ostream & s_oss, unsigned int indent) const
cxxSurface::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) const
{
//const char ERR_MESSAGE[] = "Packing surface message: %s, element not found\n";
unsigned int i;
@ -232,8 +232,8 @@ cxxSurface::dump_raw(std::ostream & s_oss, unsigned int indent) const
// Surface element and attributes
s_oss << indent0;
s_oss << "SURFACE_RAW " << this->n_user << " " << this->
description << std::endl;
int n_user_local = (n_out != NULL) ? *n_out : this->n_user;
s_oss << "SURFACE_RAW " << n_user_local << " " << this->description << std::endl;
s_oss << indent1;
//s_oss << "-diffuse_layer " << this->diffuse_layer << std::endl;

View File

@ -24,7 +24,7 @@ class cxxSurface:public cxxNumKeyword
void dump_xml(std::ostream & os, unsigned int indent = 0) const;
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out=NULL) const;
void read_raw(CParser & parser, bool check = true);

View File

@ -108,7 +108,7 @@ cxxTemperature::dump_xml(std::ostream & s_oss, unsigned int indent) const const
#endif
void
cxxTemperature::dump_raw(std::ostream & s_oss, unsigned int indent) const
cxxTemperature::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) const
{
//const char ERR_MESSAGE[] = "Packing temperature message: %s, element not found\n";
unsigned int i;
@ -122,7 +122,8 @@ cxxTemperature::dump_raw(std::ostream & s_oss, unsigned int indent) const
indent2.append(Utilities::INDENT);
s_oss << indent0;
s_oss << "REACTION_TEMPERATURE_RAW " << this->n_user << " " << this->description << std::endl;
int n_user_local = (n_out != NULL) ? *n_out : this->n_user;
s_oss << "REACTION_TEMPERATURE_RAW " << n_user_local << " " << this->description << std::endl;
s_oss << indent1;
s_oss << "-count_temps " << this->countTemps << std::endl;

View File

@ -19,7 +19,7 @@ class cxxTemperature:public cxxNumKeyword
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out=NULL) const;
void read_raw(CParser & parser);

View File

@ -154,7 +154,7 @@ cxxKinetics::dump_xml(std::ostream & s_oss, unsigned int indent) const const
#endif
void
cxxKinetics::dump_raw(std::ostream & s_oss, unsigned int indent) const
cxxKinetics::dump_raw(std::ostream & s_oss, unsigned int indent, int * n_out) const
{
//const char ERR_MESSAGE[] = "Packing kinetics message: %s, element not found\n";
unsigned int i;
@ -169,8 +169,8 @@ cxxKinetics::dump_raw(std::ostream & s_oss, unsigned int indent) const
// Kinetics element and attributes
s_oss << indent0;
s_oss << "KINETICS_RAW " << this->n_user << " " << this->
description << std::endl;
int n_user_local = (n_out != NULL) ? *n_out : this->n_user;
s_oss << "KINETICS_RAW " << n_user_local << " " << this->description << std::endl;
s_oss << indent1;
s_oss << "-step_divide " << this->step_divide << std::endl;

View File

@ -24,7 +24,7 @@ class cxxKinetics:public cxxNumKeyword
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void dump_raw(std::ostream & s_oss, unsigned int indent, int * n_out=NULL) const;
void read_raw(CParser & parser, bool check = true);

View File

@ -96,7 +96,7 @@ cxxMix::dump_xml(std::ostream & s_oss, unsigned int indent) const const
#endif
void
cxxMix::dump_raw(std::ostream & s_oss, unsigned int indent) const
cxxMix::dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out) const
{
//const char ERR_MESSAGE[] = "Packing mix message: %s, element not found\n";
unsigned int i;
@ -111,8 +111,8 @@ cxxMix::dump_raw(std::ostream & s_oss, unsigned int indent) const
// Mix element and attributes
s_oss << indent0;
s_oss << "MIX " << this->n_user << " " << this->
description << std::endl;
int n_user_local = (n_out != NULL) ? *n_out : this->n_user;
s_oss << "MIX " << n_user_local << " " << this->description << std::endl;
for (std::map < int, double >::const_iterator it = this->mixComps.begin();
it != this->mixComps.end(); it++)

View File

@ -19,7 +19,7 @@ class cxxMix:public cxxNumKeyword
//void dump_xml(std::ostream& os, unsigned int indent = 0)const;
void dump_raw(std::ostream & s_oss, unsigned int indent) const;
void dump_raw(std::ostream & s_oss, unsigned int indent, int *n_out=NULL) const;
void read_raw(CParser & parser);