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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
//-------------------------------------------------
//
/** \class L1TriggerLutFile
*
* Auxiliary class to handle Look-up table files
*
*
* $Date: 2007/03/30 07:48:02 $
* $Revision: 1.1 $
*
* N. Neumeister CERN EP
*/
//
//--------------------------------------------------
#ifndef L1_TRIGGER_LUT_FILE_H
#define L1_TRIGGER_LUT_FILE_H
//---------------
// C++ Headers --
//---------------
#include <string>
#include <fstream>
//----------------------
// Base Class Headers --
//----------------------
//------------------------------------
// Collaborating Class Declarations --
//------------------------------------
// ---------------------
// -- Class Interface --
// ---------------------
class L1TriggerLutFile {
public:
/// constructor
L1TriggerLutFile(const std::string name = "");
/// copy constructor
L1TriggerLutFile(const L1TriggerLutFile&);
/// destructor
virtual ~L1TriggerLutFile();
/// assignment operator
L1TriggerLutFile& operator=(const L1TriggerLutFile&);
/// return filename
inline const std::string& getName() const { return m_file; }
/// open file
int open();
/// return status of file stream
inline bool good() { return m_fin.good(); }
/// return status of file stream
inline bool bad() { return m_fin.bad(); }
/// close file
inline void close() { m_fin.close(); }
/// read and ignore n lines from file
void ignoreLines(int n);
/// read one integer from file
int readInteger();
/// read one hex from file
int readHex();
/// read one string from file
std::string readString();
private:
std::ifstream m_fin; // input file stream
std::string m_file; // file name
};
#endif
|