iphreeqc/NameDouble.h
David L Parkhurst 2b76f04a8b Cleaned up header files to remove unnecessary includes of .h files. Moved includes to source code where possible.
Moved some methods for .h to source files to avoid need for includes.

Debug and Release compile. 

Still need to get class version working. 

git-svn-id: svn://136.177.114.72/svn_GW/phreeqcpp/trunk@3868 1feff8c3-07ed-0310-ac33-dd36852eb9cd
2009-12-07 19:49:38 +00:00

96 lines
1.9 KiB
C++

#if !defined(NAMEDOUBLE_H_INCLUDED)
#define NAMEDOUBLE_H_INCLUDED
//#define EXTERNAL extern
#include <cassert> // assert
#include <map> // std::map
#include <string> // std::string
#include <list> // std::list
#include <vector> // std::vector
#include "Parser.h"
class cxxNameDouble:public
std::map < std::string, double >
{
public:
enum ND_TYPE
{
ND_ELT_MOLES = 1,
ND_SPECIES_LA = 2,
ND_SPECIES_GAMMA = 3,
ND_NAME_COEF = 4
};
cxxNameDouble();
cxxNameDouble(struct elt_list *);
cxxNameDouble(struct elt_list *, int count);
cxxNameDouble(struct conc *);
cxxNameDouble(struct master_activity *ma, int count, ND_TYPE);
cxxNameDouble(struct name_coef *nc, int count);
cxxNameDouble(const cxxNameDouble & old, double factor);
~
cxxNameDouble();
struct elt_list *
elt_list();
struct master_activity *
master_activity() const;
struct conc *
conc() const;
struct name_coef *
name_coef() const;
void
dump_xml(std::ostream & s_oss, unsigned int indent) const;
void
dump_raw(std::ostream & s_oss, unsigned int indent) const;
CParser::STATUS_TYPE
read_raw(CParser & parser, std::istream::pos_type & pos);
void
add_extensive(const cxxNameDouble & old, double factor);
void
add_intensive(const cxxNameDouble & addee, double fthis, double f2);
void
add_log_activities(const cxxNameDouble & addee, double fthis, double f2);
void
add(const char *key, double total);
void
multiply(double factor);
void
insert(char *str, double d)
{
(*this)[str] = d;
}
void
mpi_pack(std::vector < int >&ints, std::vector < double >&doubles);
void
mpi_pack(int *ints, int *ii, double *doubles, int *dd);
void
mpi_unpack(int *ints, int *ii, double *doubles, int *dd);
enum ND_TYPE
type;
protected:
//std::map <char *, double, CHARSTAR_LESS> totals;
public:
//static std::map<int, cxxNameDouble>& map;
};
#endif // !defined(NAMEDOUBLE_H_INCLUDED)