#ifndef DaqStartUp_HH
#define DaqStartUp_HH

#include <string>
#include <iostream>

#include "UtlPack.hh"

#include "DaqRunStart.hh"


class DaqStartUp {

public:
  enum {
    versionNumber=0
  };

  DaqStartUp();

  void reset();
  
  DaqRunType runType() const;
  void       runType(DaqRunType t);

  unsigned maximumNumberOfRunsInJob() const;
  void     maximumNumberOfRunsInJob(unsigned m);

  std::ostream& print(std::ostream &o, std::string s="") const;


private:
  DaqRunType _runType;
  unsigned _maximumNumberOfRunsInJob;
};


#ifdef CALICE_DAQ_ICC


DaqStartUp::DaqStartUp() {
  reset();
}

void DaqStartUp::reset() {
  _runType.type(DaqRunType::daq);
  _runType.subtype(DaqRunType::daqTest);
  _runType.version(0);
  _maximumNumberOfRunsInJob=0xffffffff;
}

DaqRunType DaqStartUp::runType() const {
  return _runType;
}

void DaqStartUp::runType(DaqRunType t) {
  _runType=t;
}

unsigned DaqStartUp::maximumNumberOfRunsInJob() const {
  return _maximumNumberOfRunsInJob;
}

void DaqStartUp::maximumNumberOfRunsInJob(unsigned m) {
  _maximumNumberOfRunsInJob=m;
}

std::ostream& DaqStartUp::print(std::ostream &o, std::string s) const {
  o << s << "DaqStartUp::print()" << std::endl;
  _runType.print(o,s+" ");
  o << s << " Maximum numbers of runs " 
    << _maximumNumberOfRunsInJob << std::endl;
  
  return o;
}

#endif
#endif
