CMS 3D CMS Logo

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