#ifndef AppInfoHolder_HPP
#define AppInfoHolder_HPP

#include <vector>
#include <set>
#include <string>

using std::string;
using std::set;
using std::vector;

#include <iostream> //FIXME REMOVE: For debugging only
using std::cout;
using std::endl;

  class AppInfoHolder{

    private:

      //FIXME: Check if we need requesting ASCT IOR here
      unsigned int pid_;
      string asctApplicationId_;      
      string applicationId_;
      string processId_;
      class AsctStub *asctStub_;
      vector<string> outputFiles_;
      bool useOppStore_;
      double startTime_;
      int restartId_; 


    public:

      AppInfoHolder(){}
      AppInfoHolder(unsigned int pid,
                    const string & asctApplicationId,
                    const string & applicationId,
                    const string & processId,
                    class AsctStub * asctStub,
                    const vector<string> &  outputFiles,
                    const double startTime):pid_(pid),
                                            asctApplicationId_(asctApplicationId),
                                            applicationId_(applicationId),
                                            processId_(processId),
                                            asctStub_(asctStub),
                                            outputFiles_(outputFiles),
                                            startTime_(startTime), 
                                            restartId_(0) {}

      void addOutputFile(string filename){ outputFiles_.push_back(filename); }
      
      void setPid(int pid) {pid_ = pid;};
      void setRestartId(int restartId) {restartId_ = restartId;};
      void useOppStore(bool useOppStore) { useOppStore_ = useOppStore; }

      int restartId() const{ return restartId_; }
      int pid() const{ return pid_; }
      const double & startTime() const{ return startTime_; }         
      const string & asctApplicationId() const{ return asctApplicationId_; }
      const string & applicationId() const{ return applicationId_; }
      const string & processId() const{ return processId_; }
      class AsctStub * asctStub() const{ return asctStub_; }
      bool useOppStore() const{ return useOppStore_; }
      const vector<string> & outputFiles() const{ return outputFiles_; }


      void dump() const{
        cout << "Dumping AppInfoHolder: " << endl
             << "applicationId: " << applicationId_ << endl
             << "processId: " << processId_ << endl
             << "pid: " << pid_ << endl   << endl
             << "output files: ";
        for(unsigned int i = 0; i < outputFiles_.size(); i ++)
          cout << outputFiles_[i] << " ";
        cout << endl;

      }
  };//class

#endif//AppInfoHolder_HPP

