forked from cms-patatrack/pixeltrack-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FEDRawData.h
55 lines (42 loc) · 1.41 KB
/
FEDRawData.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef FEDRawData_FEDRawData_h
#define FEDRawData_FEDRawData_h
/** \class FEDRawData
*
* Class representing the raw data for one FED.
* The raw data is owned as a binary buffer. It is required that the
* lenght of the data is a multiple of the S-Link64 word lenght (8 byte).
* The FED data should include the standard FED header and trailer.
*
* \author G. Bruno - CERN, EP Division
* \author S. Argiro - CERN and INFN -
* Refactoring and Modifications to fit into CMSSW
*/
#include <vector>
#include <cstddef>
class FEDRawData {
public:
typedef std::vector<unsigned char> Data;
typedef Data::iterator iterator;
/// Default ctor
FEDRawData();
/// Ctor specifying the size to be preallocated, in bytes.
/// It is required that the size is a multiple of the size of a FED
/// word (8 bytes)
FEDRawData(size_t newsize);
/// Copy constructor
FEDRawData(const FEDRawData &);
/// Dtor
~FEDRawData();
/// Return a const pointer to the beginning of the data buffer
const unsigned char *data() const;
/// Return a pointer to the beginning of the data buffer
unsigned char *data();
/// Lenght of the data buffer in bytes
size_t size() const { return data_.size(); }
/// Resize to the specified size in bytes. It is required that
/// the size is a multiple of the size of a FED word (8 bytes)
void resize(size_t newsize);
private:
Data data_;
};
#endif