5 #ifndef INC_IPHREEQC_HPP
6 #define INC_IPHREEQC_HPP
13 #include "IPhreeqcCallbacks.h"
17 #include "PHRQ_exports.h"
21 class CSelectedOutput;
33 virtual const char *what()
const throw () {
return "Failure in IPhreeqc\n";}
78 size_t AddError(
const char* error_msg);
101 const std::string& GetAccumulatedLines(
void);
235 int GetId(
void)
const;
627 std::list< std::string > ListComponents(
void);
689 int RunFile(
const char* filename);
710 void SetBasicCallback(
double (*fcn)(
double x1,
double x2,
const char *str,
void *cookie),
void * cookie1);
720 #ifdef IPHREEQC_NO_FORTRAN_MODULE
876 virtual void error_msg(
const char *str,
bool stop=
false);
877 virtual void log_msg(
const char * str);
878 virtual void output_msg(
const char *str);
879 virtual void punch_msg(
const char *str);
880 virtual void screen_msg(
const char *str);
881 virtual void warning_msg(
const char *str);
883 virtual void fpunchf(
const char *name,
const char *format,
double d);
884 virtual void fpunchf(
const char *name,
const char *format,
char * d);
885 virtual void fpunchf(
const char *name,
const char *format,
int d);
886 virtual void fpunchf_end_row(
const char *format);
888 virtual bool output_open(
const char *file_name, std::ios_base::openmode mode = std::ios_base::out);
889 virtual bool punch_open(
const char *file_name, std::ios_base::openmode mode = std::ios_base::out,
int n_user = 1);
893 void AddSelectedOutput(
const char* name,
const char* format, va_list argptr);
894 void UnLoadDatabase(
void);
896 void check_database(
const char* sz_routine);
897 int close_input_files(
void);
898 int close_output_files(
void);
899 void open_output_files(
const char* sz_routine);
901 void do_run(
const char* sz_routine, std::istream* pis, PFN_PRERUN_CALLBACK pfn_pre, PFN_POSTRUN_CALLBACK pfn_post,
void *cookie);
903 void update_errors(
void);
905 int load_db(
const char* filename);
906 int load_db_str(
const char* filename);
909 bool get_sel_out_file_on(
int n)
const;
910 std::string sel_file_name(
int n_user);
912 std::string create_file_name(
const char *prefix,
const char *suffix);
914 bool get_sel_out_string_on(
int n)
const;
917 #if defined(_MSC_VER)
919 #pragma warning(disable:4251)
923 bool ClearAccumulated;
924 bool UpdateComponents;
925 std::map< int, bool > SelectedOutputFileOnMap;
936 std::string OutputString;
937 std::vector< std::string > OutputLines;
940 std::string LogString;
941 std::vector< std::string > LogLines;
944 IErrorReporter *ErrorReporter;
945 std::string ErrorString;
946 std::vector< std::string > ErrorLines;
948 bool WarningStringOn;
949 IErrorReporter *WarningReporter;
950 std::string WarningString;
951 std::vector< std::string > WarningLines;
953 int CurrentSelectedOutputUserNumber;
954 std::map< int, CSelectedOutput* > SelectedOutputMap;
955 std::string StringInput;
957 std::string DumpString;
958 std::vector< std::string > DumpLines;
960 std::list< std::string > Components;
961 std::list< std::string > EquilibriumPhasesList;
962 const std::list<std::string> &GetEquilibriumPhasesList() {
return this->EquilibriumPhasesList; };
963 std::list< std::string > GasComponentsList;
964 const std::list<std::string> &GetGasComponentsList() {
return this->GasComponentsList; };
965 std::list< std::string > KineticReactionsList;
966 const std::list<std::string> &GetKineticReactionsList() {
return this->KineticReactionsList; };
967 std::list< std::string > SolidSolutionComponentsList;
968 const std::list<std::string> &GetSolidSolutionComponentsList() {
return this->SolidSolutionComponentsList; };
969 std::list< std::string > SolidSolutionNamesList;
970 const std::list<std::string> &GetSolidSolutionNamesList() {
return this->SolidSolutionNamesList; };
973 std::list< std::string > SurfaceTypeList;
974 const std::list<std::string> &GetSurfaceTypeList() {
return this->SurfaceTypeList; };
975 std::list< std::string > SurfaceNamesList;
976 const std::list<std::string> &GetSurfaceNamesList() {
return this->SurfaceNamesList; };
979 std::list< std::string > ExchangeNamesList;
980 const std::list<std::string> &GetExchangeNamesList() {
return this->ExchangeNamesList; };
982 std::map< int, std::string > SelectedOutputFileNameMap;
984 std::string OutputFileName;
985 std::string ErrorFileName;
986 std::string LogFileName;
987 std::string DumpFileName;
989 std::map< int, bool > SelectedOutputStringOn;
990 std::map< int, std::string > SelectedOutputStringMap;
991 std::map< int, std::vector< std::string > > SelectedOutputLinesMap;
998 friend class IPhreeqcLib;
999 static std::map<size_t, IPhreeqc*> Instances;
1000 static size_t InstancesIndex;
1003 static std::string Version;
1005 #if defined(_MSC_VER)
1007 #pragma warning(default:4251)
1010 #if defined(CPPUNIT)
1011 friend class TestIPhreeqc;
1012 friend class TestSelectedOutput;
1027 #endif // INC_IPHREEQC_HPP
IPQ_DLL_EXPORT int GetDumpStringOn(int id)
IPQ_DLL_EXPORT int GetWarningStringLineCount(int id)
IPQ_DLL_EXPORT IPQ_RESULT SetDumpFileName(int id, const char *filename)
IPQ_DLL_EXPORT IPQ_RESULT SetCurrentSelectedOutputUserNumber(int id, int n)
IPQ_DLL_EXPORT const char * GetLogFileName(int id)
IPQ_DLL_EXPORT const char * GetSelectedOutputFileName(int id)
IPQ_DLL_EXPORT int RunString(int id, const char *input)
IPQ_DLL_EXPORT IPQ_RESULT SetLogFileOn(int id, int log_on)
IPQ_DLL_EXPORT const char * GetComponent(int id, int n)
IPQ_DLL_EXPORT int GetLogStringOn(int id)
IPQ_DLL_EXPORT IPQ_RESULT SetSelectedOutputFileOn(int id, int sel_on)
IPQ_DLL_EXPORT IPQ_RESULT SetLogFileName(int id, const char *filename)
IPQ_DLL_EXPORT IPQ_RESULT SetErrorOn(int id, int error_on)
IPQ_DLL_EXPORT IPQ_RESULT GetSelectedOutputValue2(int id, int row, int col, int *vtype, double *dvalue, char *svalue, unsigned int svalue_length)
IPQ_DLL_EXPORT int GetSelectedOutputStringOn(int id)
IPQ_DLL_EXPORT const char * GetErrorString(int id)
IPQ_DLL_EXPORT const char * GetErrorFileName(int id)
IPQ_DLL_EXPORT IPQ_RESULT SetLogStringOn(int id, int log_string_on)
IPQ_DLL_EXPORT const char * GetOutputString(int id)
IPQ_DLL_EXPORT const char * GetLogStringLine(int id, int n)
IPQ_DLL_EXPORT int AddError(int id, const char *error_msg)
IPQ_DLL_EXPORT IPQ_RESULT SetSelectedOutputFileName(int id, const char *filename)
IPQ_DLL_EXPORT int GetCurrentSelectedOutputUserNumber(int id)
IPQ_DLL_EXPORT IPQ_RESULT SetDumpFileOn(int id, int dump_on)
IPQ_DLL_EXPORT IPQ_RESULT SetOutputFileName(int id, const char *filename)
IPQ_DLL_EXPORT IPQ_RESULT GetSelectedOutputValue(int id, int row, int col, VAR *pVAR)
IPQ_DLL_EXPORT const char * GetSelectedOutputStringLine(int id, int n)
IPQ_DLL_EXPORT int GetNthSelectedOutputUserNumber(int id, int n)
IPQ_DLL_EXPORT int GetSelectedOutputCount(int id)
IPQ_DLL_EXPORT int GetSelectedOutputFileOn(int id)
IPQ_DLL_EXPORT int GetOutputFileOn(int id)
IPQ_DLL_EXPORT IPQ_RESULT SetErrorFileOn(int id, int error_on)
IPQ_DLL_EXPORT int GetOutputStringOn(int id)
IPQ_DLL_EXPORT const char * GetOutputFileName(int id)
IPQ_DLL_EXPORT IPQ_RESULT AccumulateLine(int id, const char *line)
IPQ_DLL_EXPORT const char * GetDumpFileName(int id)
IPQ_DLL_EXPORT const char * GetDumpString(int id)
IPQ_DLL_EXPORT IPQ_RESULT SetSelectedOutputStringOn(int id, int sel_string_on)
IPQ_DLL_EXPORT int GetErrorFileOn(int id)
IPQ_DLL_EXPORT const char * GetOutputStringLine(int id, int n)
IPQ_DLL_EXPORT int GetSelectedOutputStringLineCount(int id)
IPQ_DLL_EXPORT int GetSelectedOutputColumnCount(int id)
IPQ_DLL_EXPORT IPQ_RESULT SetBasicCallback(int id, double(*fcn)(double x1, double x2, const char *str, void *cookie), void *cookie1)
IPQ_DLL_EXPORT const char * GetWarningStringLine(int id, int n)
IPQ_DLL_EXPORT void OutputWarningString(int id)
IPQ_DLL_EXPORT IPQ_RESULT ClearAccumulatedLines(int id)
IPQ_DLL_EXPORT IPQ_RESULT SetOutputFileOn(int id, int output_on)
IPQ_DLL_EXPORT int RunFile(int id, const char *filename)
IPhreeqc VARIANT Documentation
IPQ_DLL_EXPORT int GetComponentCount(int id)
IPQ_DLL_EXPORT const char * GetLogString(int id)
IPQ_DLL_EXPORT void OutputErrorString(int id)
IPQ_DLL_EXPORT int GetLogFileOn(int id)
IPQ_DLL_EXPORT int RunAccumulated(int id)
IPQ_DLL_EXPORT const char * GetSelectedOutputString(int id)
IPQ_DLL_EXPORT int GetErrorStringOn(int id)
IPQ_DLL_EXPORT int GetDumpFileOn(int id)
IPQ_DLL_EXPORT int GetSelectedOutputRowCount(int id)
Datatype used to store SELECTED_OUTPUT values.
Definition: Var.h:40
IPQ_DLL_EXPORT const char * GetErrorStringLine(int id, int n)
IPQ_DLL_EXPORT void OutputAccumulatedLines(int id)
IPQ_DLL_EXPORT IPQ_RESULT SetBasicFortranCallback(int id, double(*fcn)(double *x1, double *x2, const char *str, int l))
IPQ_DLL_EXPORT int LoadDatabase(int id, const char *filename)
IPQ_DLL_EXPORT IPQ_RESULT SetErrorStringOn(int id, int error_string_on)
IPQ_DLL_EXPORT int AddWarning(int id, const char *warn_msg)
IPQ_DLL_EXPORT IPQ_RESULT SetDumpStringOn(int id, int dump_string_on)
IPQ_DLL_EXPORT IPQ_RESULT SetOutputStringOn(int id, int output_string_on)
IPQ_DLL_EXPORT const char * GetWarningString(int id)
IPQ_DLL_EXPORT int GetErrorOn(int id)
IPQ_DLL_EXPORT int GetDumpStringLineCount(int id)
IPQ_DLL_EXPORT int LoadDatabaseString(int id, const char *input)
VRESULT
Enumeration used to return error codes.
Definition: Var.h:29
IPQ_DLL_EXPORT const char * GetVersionString(void)
IPQ_DLL_EXPORT int GetLogStringLineCount(int id)
IPQ_DLL_EXPORT int GetErrorStringLineCount(int id)
This class is derived from std::exception and is thrown when an unrecoverable error has occured...
Definition: IPhreeqc.hpp:30
IPQ_DLL_EXPORT int GetOutputStringLineCount(int id)
IPQ_DLL_EXPORT IPQ_RESULT SetErrorFileName(int id, const char *filename)
IPQ_DLL_EXPORT const char * GetDumpStringLine(int id, int n)
Provides an interface to PHREEQC (Version 3)–A Computer Program for Speciation, Batch-Reaction, One-Dimensional Transport, and Inverse Geochemical Calculations.
Definition: IPhreeqc.hpp:44