-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCModuleUnpacker.h
68 lines (49 loc) · 1.56 KB
/
CModuleUnpacker.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
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
This software is Copyright by the Board of Trustees of Michigan
State University (c) Copyright 2005.
You may use this software under the terms of the GNU public license
(GPL). The terms of this license are described at:
http://www.gnu.org/licenses/gpl.txt
Author:
Ron Fox
NSCL
Michigan State University
East Lansing, MI 48824-1321
*/
#ifndef __CMODULEUNPACKER_H
#define __CMODULEUNPACKER_H
#ifndef __CPARAMMAPCOMMAND_H
#include "CParamMapCommand.h"
#endif
#ifndef __STL_VECTOR
#include <vector>
#ifndef __STL_VECTOR
#define __STL_VECTOR
#endif
#endif
// Forward definitions:
class CEvent;
/*!
This is the abstract base class for module unpackers used by the CStackUnpacker
class. A concrete class must be created for each actual module type.
The key method each class must implement is, of course the operator() method.
This method must unpack the next chunk of the event into the parameters defined
by its parameter map. The operator must return a pointer to the next
unconsumed part of the event.
*/
class CModuleUnpacker
{
// Canonicals:
public:
virtual ~CModuleUnpacker(); // To support destructor chaining in a complex class hierarchy.
// pure virtual functions:
public:
virtual unsigned int operator()(CEvent& rEvent,
std::vector<unsigned short>& event,
unsigned int offset,
CParamMapCommand::AdcMapping* pMap) = 0;
protected:
static unsigned long getLong(std::vector<unsigned short>& event,
unsigned int offset);
};
#endif