CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FEDRawData.cc
Go to the documentation of this file.
1 
11 #include <iostream>
12 
13 using namespace std;
14 
16 {
17 }
18 
19 FEDRawData::FEDRawData(size_t newsize):data_(newsize){
20  if (newsize%8!=0) throw cms::Exception("DataCorrupt") << "FEDRawData::resize: " << newsize << " is not a multiple of 8 bytes." << endl;
21 }
22 
23 FEDRawData::FEDRawData(const FEDRawData &in) : data_(in.data_)
24 {
25 }
27 {
28 }
29 const unsigned char * FEDRawData::data()const {return &data_[0];}
30 
31 unsigned char * FEDRawData::data() {return &data_[0];}
32 
33 void FEDRawData::resize(size_t newsize) {
34  if (size()==newsize) return;
35 
36  data_.resize(newsize);
37 
38  if (newsize%8!=0) throw cms::Exception("DataCorrupt") << "FEDRawData::resize: " << newsize << " is not a multiple of 8 bytes." << endl;
39 }
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
FEDRawData()
Default ctor.
Definition: FEDRawData.cc:15
void resize(size_t newsize)
Definition: FEDRawData.cc:33
Data data_
Definition: FEDRawData.h:58
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
~FEDRawData()
Dtor.
Definition: FEDRawData.cc:26