1 |
kusanagi |
1.1 |
/** @file |
2 |
|
|
* $Source: /home/cvspamela/yoda/techmodel/ForcedPktReader.cpp,v $ |
3 |
|
|
* $Id: ForcedPktReader.cpp,v 1.1 2004/06/09 23:18:20 nagni Exp $ |
4 |
|
|
* $Author: nagni $ |
5 |
|
|
* |
6 |
|
|
* Implementation of the ForcedPkt class. |
7 |
|
|
*/ |
8 |
|
|
|
9 |
|
|
#define UINT unsigned int |
10 |
|
|
#define BYTE unsigned char |
11 |
|
|
#include <string> |
12 |
|
|
#include <log4cpp/Category.hh> |
13 |
|
|
extern "C" { |
14 |
|
|
#include <sys/time.h> |
15 |
|
|
#include "CRC.h" |
16 |
|
|
} |
17 |
|
|
|
18 |
|
|
#include <fstream> |
19 |
|
|
#include "stdio.h" |
20 |
|
|
#include "ReaderAlgorithms.h" |
21 |
|
|
|
22 |
|
|
#include "event/ForcedPktEvent.h" |
23 |
|
|
|
24 |
|
|
using namespace pamela; |
25 |
|
|
using namespace pamela::techmodel; |
26 |
|
|
|
27 |
|
|
static log4cpp::Category& cat = log4cpp::Category::getInstance("pamela.techmodel.ForcedPktReader"); |
28 |
|
|
|
29 |
|
|
/** |
30 |
|
|
* Constructor. |
31 |
|
|
*/ |
32 |
|
|
ForcedPktReader::ForcedPktReader(void): |
33 |
|
|
TechmodelAlgorithm(PacketType::Log, "TechmodelForcedPktReader") { |
34 |
|
|
cat << log4cpp::Priority::DEBUG |
35 |
|
|
<< "Constructor " |
36 |
|
|
<< "\n " << log4cpp::CategoryStream::ENDLINE; |
37 |
|
|
ForcedPkt = new ForcedPktEvent(); |
38 |
|
|
} |
39 |
|
|
|
40 |
|
|
/** |
41 |
|
|
* Get a string with the version info of the algorithm. |
42 |
|
|
*/ |
43 |
|
|
std::string ForcedPktReader::GetVersionInfo(void) const { |
44 |
|
|
return |
45 |
|
|
"$Header: /home/cvspamela/yoda/techmodel/ForcedPktReader.cpp,v 1.1 2004/06/09 23:18:20 nagni Exp $\n"; |
46 |
|
|
} |
47 |
|
|
|
48 |
|
|
/** |
49 |
|
|
* Initialize the algorithm with a special run. This will initialize the |
50 |
|
|
* event reader routines for all packet types. |
51 |
|
|
*/ |
52 |
|
|
void ForcedPktReader::Init(PamelaRun *run) { |
53 |
|
|
SetInputStream(run); |
54 |
|
|
run->WriteSubPacket(this, &ForcedPkt, ForcedPkt->Class()); |
55 |
|
|
} |
56 |
|
|
|
57 |
|
|
/** |
58 |
|
|
* Unpack the ForcedPkt event from an input file. |
59 |
|
|
*/ |
60 |
|
|
void ForcedPktReader::RunEvent(int EventNumber, long int length) { |
61 |
|
|
|
62 |
|
|
} |
63 |
|
|
|