GRUTinizer
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
TMultiRawFile.h
Go to the documentation of this file.
1 #ifndef _TMULTIRAWFILE_H_
2 #define _TMULTIRAWFILE_H_
3 
4 #include <set>
5 #ifndef __CINT__
6 # include <mutex>
7 #endif
8 
9 #include "TObject.h"
10 
11 #include "TRawEvent.h"
12 #include "TRawEventSource.h"
13 
14 struct FileEvent {
17 
18  // Needed for keeping the std::set sorted by timestamp
19  bool operator<(const FileEvent& other) const;
20 };
21 
22 bool file_event_sorting(const FileEvent& a, const FileEvent& b);
23 
25 public:
26  TMultiRawFile();
28 
29  void AddFile(TRawEventSource* infile);
30  void AddFile(const char* filename);
31 
32  bool IsValid() const { return fIsValid; }
33 
34  virtual std::string SourceDescription() const;
35  virtual std::string Status() const;
36  virtual int GetLastErrno() const;
37  virtual std::string GetLastError() const;
38 
39 private:
40  TMultiRawFile(const TMultiRawFile& other) { }
42 
43  std::set<TRawEventSource*> fFileList; // This list does not get modified frequently
44  std::set<FileEvent> fFileEvents; // This list is modified frequently
45 
46 #ifndef __CINT__
47  mutable std::mutex fFileListMutex;
48 #endif
49 
50  virtual int GetEvent(TRawEvent& outevent);
51  mutable bool fIsFirstStatus;
52  bool fIsValid;
53 
54 
56 };
57 
58 
59 
60 
61 #endif