#ifndef DIFFSECRDATA_H
#define DIFFSECRDATA_H

#include <XMLCereal/XMLSerializable.h>
// #include <CompuCell3D/FlexibleDiffusionSolverFE.h>
#include <string>

#include <vector>
#include <set>
#include <map>
#include <iostream>


namespace CompuCell3D {
class Automaton;

class SecretionOnContactData{
   public:
      std::map<unsigned char, float> contactCellMap;
      
};

class SecretionData: public XMLSerializable{
   protected:
      Automaton * automaton;
   public:
      SecretionData():
      active(false)
      {}
      void setAutomaton(Automaton * _automaton){automaton=_automaton;}
      bool active;
      std::set<std::string> secrTypesNameSet;
      
      
      //std::string secretionName;
      
      std::map<unsigned char,float> typeIdSecrConstMap;
      std::map<unsigned char,SecretionOnContactData> typeIdSecrOnContactDataMap;
      
      //XMLSerializable interface
      virtual void readXML(XMLPullParser &in);
      virtual void writeXML(XMLSerializer &out){}
      
   
};



class DiffusionData : public XMLSerializable {
      Automaton * automaton;
   public:
      DiffusionData():
      active(false),
      diffConst(0.0),
      decayConst(0.0),
      deltaX(1.0),
      deltaT(1.0)
      {}

      void setAutomaton(Automaton * _automaton){automaton=_automaton;}
      bool active;
      float diffConst;
      float decayConst; 
      float deltaX;
      float deltaT;
      float dt_dx2;
      std::string diffusionName;
      //XMLSerializable interface
      virtual void readXML(XMLPullParser &in);
      virtual void writeXML(XMLSerializer &out){}
      
      
      std::string fieldName;
      std::string concentrationFileName;
      //std::vector<std::string> avoidTypeVec;
      std::set<unsigned char> avoidTypeIdSet;
      //std::vector<std::string> secreteTypeVec;
      
      friend std::ostream & operator<<(std::ostream & out,CompuCell3D::DiffusionData & diffData);
};

inline std::ostream & operator<<(std::ostream & out,CompuCell3D::DiffusionData & diffData){
   using namespace std;
   
   out<<"DiffusionConstant: "<<diffData.diffConst<<endl;
   out<<"DecayConstant: "<<diffData.decayConst<<endl;
   out<<"DeltaX: "<<diffData.deltaX<<endl;
   out<<"DeltaT: "<<diffData.deltaT<<endl;
   out<<"fieldName: "<<diffData.fieldName<<endl;

   return out;
}

};

#endif
