-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCModuleUnpacker.cpp
More file actions
43 lines (28 loc) · 1001 Bytes
/
CModuleUnpacker.cpp
File metadata and controls
43 lines (28 loc) · 1001 Bytes
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
/*
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
*/
// Implementation of the non-pure members of the module unpacker.
#include <config.h>
#include "CModuleUnpacker.h"
CModuleUnpacker::~CModuleUnpacker()
{}
// unpack a longword from the event array...assumption is that localhost is
// little endian.
//can be the big endian too...if so, reverse the order of the byte..//Nabin
unsigned long
CModuleUnpacker::getLong(std::vector<unsigned short>& event,
unsigned int offset)
{
unsigned long low = event[offset];
unsigned long hi = event[offset+1];
return low | (hi << 16); //left arithmatic shift //so, the MSB is discarded //Nabin
}