CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/DataFormats/FEDRawData/src/FEDRawData.cc

Go to the documentation of this file.
00001 
00009 #include <DataFormats/FEDRawData/interface/FEDRawData.h>
00010 #include <FWCore/Utilities/interface/Exception.h>
00011 #include <iostream>
00012 
00013 using namespace std;
00014 
00015 FEDRawData::FEDRawData()
00016 {
00017 }
00018 
00019 FEDRawData::FEDRawData(size_t newsize):data_(newsize){
00020   if (newsize%8!=0) throw cms::Exception("DataCorrupt") << "FEDRawData::resize: " << newsize << " is not a multiple of 8 bytes." << endl;
00021 }
00022 
00023 FEDRawData::FEDRawData(const FEDRawData &in) : data_(in.data_)
00024 {
00025 }
00026 FEDRawData::~FEDRawData()
00027 {
00028 }
00029 const unsigned char * FEDRawData::data()const {return &data_[0];}
00030 
00031 unsigned char * FEDRawData::data() {return &data_[0];}
00032 
00033 void FEDRawData::resize(size_t newsize) {
00034   if (size()==newsize) return;
00035 
00036   data_.resize(newsize);
00037 
00038   if (newsize%8!=0) throw cms::Exception("DataCorrupt") << "FEDRawData::resize: " << newsize << " is not a multiple of 8 bytes." << endl;
00039 }