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 
10 #include <iostream>
11 
12 using namespace std;
13 
15 {
16 }
17 
18 FEDRawData::FEDRawData(size_t newsize):data_(newsize){
19  if (newsize%8!=0) throw cms::Exception("DataCorrupt") << "FEDRawData::resize: " << newsize << " is not a multiple of 8 bytes." << endl;
20 }
21 
22 FEDRawData::FEDRawData(const FEDRawData &in) : data_(in.data_)
23 {
24 }
26 {
27 }
28 const unsigned char * FEDRawData::data()const {return &data_[0];}
29 
30 unsigned char * FEDRawData::data() {return &data_[0];}
31 
32 void FEDRawData::resize(size_t newsize) {
33  if (size()==newsize) return;
34 
35  data_.resize(newsize);
36 
37  if (newsize%8!=0) throw cms::Exception("DataCorrupt") << "FEDRawData::resize: " << newsize << " is not a multiple of 8 bytes." << endl;
38 }
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
FEDRawData()
Default ctor.
Definition: FEDRawData.cc:14
void resize(size_t newsize)
Definition: FEDRawData.cc:32
Data data_
Definition: FEDRawData.h:56
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
~FEDRawData()
Dtor.
Definition: FEDRawData.cc:25