//*****************************************************
// Class          : SmtChipStatusChunk
// 
// Author         : Alex Melnitchouk
//
// Creation Date  : December 2004
//                  made following SmtDataChunk
//*****************************************************


#include "smtdata/SmtChipStatusChunk.hpp"

//class SmtData;

namespace {
  enum { VERSION = 5, CHIPSTATUSBITSETSIZE = 6267};
}

#ifndef DEFECT_NO_NAMESPACES
//using edm::AbsChunk;
using edm::ChunkID;
using edm::RCPID;
using edm::EnvID;
#endif
using std::list;
using std::vector;
using std::find;
using std::sort;
using std::string;
using std::cout;
using std::endl;
using std::bitset;
//--------------------------------------------------------
// Constructor/Destructor
//--------------------------------------------------------
//SmtChipStatusChunk::SmtChipStatusChunk(): _version(0)
//{
//}

SmtChipStatusChunk::SmtChipStatusChunk() : _version(VERSION), _chip_status_bitset_size(CHIPSTATUSBITSETSIZE)
{

}

SmtChipStatusChunk::SmtChipStatusChunk(bitset<6267> chip_status_bitset) : _version(VERSION), _chip_status_bitset_size(CHIPSTATUSBITSETSIZE)
{
  for (int i=0; i<6267; i++) cout<<"chunk constructor: i, chip_status_bitset = "<<i<<"   "<<chip_status_bitset.test(i)<<endl;
  _chip_status_bitset.reset();
  _chip_status_bitset = chip_status_bitset;
  cout<<endl;
  for (int _i=0; _i<6267; _i++) cout<<"chunk constructor: _i, _chip_status_bitset = "<<_i<<"   "<<_chip_status_bitset.test(_i)<<endl;

}

SmtChipStatusChunk::~SmtChipStatusChunk()
{

}



//--------------------------------------------------------
// SmtData 
//--------------------------------------------------------
/*SmtData* SmtChipStatusChunk::getSmtData() const{
 return _smtdata;
}*/

list<ChunkID> SmtChipStatusChunk::parents() const {
  list<ChunkID> ids;
  //empty for now
  return ids;
}

list<RCPID> SmtChipStatusChunk::rcps() const {
  list<RCPID> ids;
  //empty for now
  return ids;
}

list<EnvID> SmtChipStatusChunk::environment() const {
  list<EnvID> ids;
  //empty for now
  return ids;
}

void SmtChipStatusChunk::printChunk(std::ostream& out) const{
  out << endl << "This is an SmtChipStatusChunk." << endl << endl;
  //SmtData* smtdata = this->getSmtData();
  // suppress print out for now...
  //  out << smtdata;
}