00001 // Chemical.h: interface for the Chemical class. 00002 // 00004 00005 #if !defined(AFX_CHEMICAL_H__17E9EE5E_DB43_11D3_8099_00A0C9B3BB18__INCLUDED_) 00006 #define AFX_CHEMICAL_H__17E9EE5E_DB43_11D3_8099_00A0C9B3BB18__INCLUDED_ 00007 00008 #if _MSC_VER > 1000 00009 #pragma once 00010 #endif // _MSC_VER > 1000 00011 00012 #ifdef _WIN32 00013 #include <strstream> 00014 using namespace std; 00015 #else 00016 using namespace std; 00017 #endif 00018 00019 #include <vector> 00020 #include <string.h> 00021 //#include <strstrea.h> 00022 #include "Reaction.h" 00023 00024 class Reaction; // Both files refer to one another 00025 00026 class Chemical 00027 { 00028 public: 00029 std::string GetName() const; 00030 std::string GetTeXName() const {return m_sTeXName;} 00031 Chemical(); 00032 Chemical(int chemicalNumber, double amount=0, std::string name=""); 00033 Chemical(int chemicalNumber, double amount, double errorInInitialAmount, std::string name); 00034 virtual ~Chemical(); 00035 double GetAmount() const; 00036 double GetInitialAmount() const; 00037 double GetErrorInInitialAmount() const; 00038 virtual void SetErrorInInitialAmount(double errorInInitialAmount); 00039 virtual void SetAmount(double amount); 00040 virtual void SetInitialAmount(double initialAmount); 00041 virtual void IncrementAmount(double change); 00042 virtual void Reset(); 00043 const std::vector<Reaction *> *GetReactions() const; 00044 int GetChemicalNumber(); 00045 void SetTeXName(); 00046 protected: 00047 int chemicalNumber; // In the array of all chemicals, which one am I? 00048 std::vector<Reaction *> reactions; // Reactions that depend or affect the chemical 00049 double amount; // current amount of chemical 00050 double initialAmount; // initial amount of chemical 00051 double errorInInitialAmount; // uncertainty in initial amount 00052 std::string name; 00053 std::string m_sTeXName; 00054 }; 00055 00056 #endif // !defined(AFX_CHEMICAL_H__17E9EE5E_DB43_11D3_8099_00A0C9B3BB18__INCLUDED_)