CFEL - ASG Software Suite  2.5.0
CASS
xtc_reader.h
Go to the documentation of this file.
1 // Copyright (C) 2011 Lutz Foucar
2 
3 /**
4  * @file xtc_reader.h contains class to read xtc files
5  *
6  * @author Lutz Foucar
7  */
8 
9 #ifndef _XTCREADER_H_
10 #define _XTCREADER_H_
11 
12 #include <tr1/memory>
13 #include <fstream>
14 #include <string>
15 
16 #include "file_reader.h"
17 
18 namespace cass
19 {
20  class CASSEvent;
21  class FormatConverter;
22 
23  /** class for reading xtc files
24  *
25  * it uses the format converter to the xtc datagrams to cassevent
26  *
27  * @author Lutz Foucar
28  */
29  class XtcReader : public FileReader
30  {
31  public:
32  /** constructor */
33  XtcReader();
34 
35  /** read the xtc file contents put them into cassevent
36  *
37  * read datagrams until the return value of the conversion is true, which
38  * indicates
39  *
40  * @return true when the workers should work on the filled cassevent,
41  * false if not.
42  * @param file the file that contains the data to be put into the cassevent
43  * @param event the CASSEvent where the data will be put into
44  */
45  bool operator()(std::ifstream &file, CASSEvent& event);
46 
47  /** load the settings of the reader */
48  void loadSettings();
49 
50  /** read the file header
51  *
52  * read datagram by datagram until the first L1 transition appears
53  *
54  * @param file the filestream to the header information of the file
55  */
56  void readHeaderInfo(std::ifstream &file);
57 
58  private:
59  /** a reference to the format converter functor */
61  };
62 }
63 #endif
Event to store all LCLS Data.
Definition: cass_event.h:32
void readHeaderInfo(std::ifstream &file)
read the file header
Definition: xtc_reader.cpp:48
Format converter container.
bool operator()(std::ifstream &file, CASSEvent &event)
read the xtc file contents put them into cassevent
Definition: xtc_reader.cpp:70
base class for all file readers
Definition: file_reader.h:24
XtcReader()
constructor
Definition: xtc_reader.cpp:38
class for reading xtc files
Definition: xtc_reader.h:29
contains base class for all file readers
FormatConverter & _convert
a reference to the format converter functor
Definition: xtc_reader.h:60
void loadSettings()
load the settings of the reader
Definition: xtc_reader.cpp:43