forked from cms-patatrack/pixeltrack-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFEDRawData.cc
34 lines (24 loc) · 882 Bytes
/
FEDRawData.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/** \file
implementation of class FedRawData
\author Stefano ARGIRO
\date 28 Jun 2005
*/
#include "DataFormats/FEDRawData.h"
#include <iostream>
using namespace std;
FEDRawData::FEDRawData() {}
FEDRawData::FEDRawData(size_t newsize) : data_(newsize) {
if (newsize % 8 != 0)
throw std::runtime_error("FEDRawData::resize: " + std::to_string(newsize) + " is not a multiple of 8 bytes.");
}
FEDRawData::FEDRawData(const FEDRawData &in) : data_(in.data_) {}
FEDRawData::~FEDRawData() {}
const unsigned char *FEDRawData::data() const { return data_.data(); }
unsigned char *FEDRawData::data() { return data_.data(); }
void FEDRawData::resize(size_t newsize) {
if (size() == newsize)
return;
data_.resize(newsize);
if (newsize % 8 != 0)
throw std::runtime_error("FEDRawData::resize: " + std::to_string(newsize) + " is not a multiple of 8 bytes.");
}