EventFileChain.h
Go to the documentation of this file.
1 #ifndef _io_EventFileChain_h_
2 #define _io_EventFileChain_h_
3 
4 #include <io/IoCodes.h>
5 
6 #include <utl/Reader.h>
7 #include <utl/Branch.h>
8 
9 #include <string>
10 #include <vector>
11 
12 
13 namespace evt {
14  class Event;
15 }
16 
17 namespace io {
18 
19  class EventFile;
20 
21 
34 
35  public:
36  EventFileChain(utl::Branch& branch);
37 
38  EventFileChain(const Type type) : fType(type) { }
39 
41 
44  EventFileChain(const std::string& filenames, const Type type);
45 
47  EventFileChain(const std::vector<std::string>& filenames, const Type type);
48 
50 
52 
53  Status Read(evt::Event& event);
54 
55  const std::string& GetCurrentFilename() const;
56 
57  void SetFileList(const std::vector<std::string>& filenames);
58 
59  Type GetFileType() const { return fType; }
60 
61  void SetIgnoreExceptions(const bool ignore) { fCatchExceptions = ignore; }
62 
63  private:
65  EventFileChain(const EventFileChain& eventFileChain);
66  EventFileChain& operator=(const EventFileChain& eventFileChain);
67 
68  inline Status OpenCurrent();
69 
70  void Parse();
71 
72  static void InitXMLDictionary();
73 
75 
76  typedef std::vector<std::string> FileContainer;
77 
79  FileContainer::iterator fFileIterator{fFileList.end()};
80 
81  EventFile* fOpenFile = nullptr;
83 
84  bool fCatchExceptions = false;
85 
86  static std::map<std::string, std::string> fgXMLDictionary;
87 
88  };
89 
90 }
91 
92 
93 #endif
Status Read(evt::Event &event)
read current event and advance cursor by 1
FileContainer fFileList
const std::string & GetCurrentFilename() const
EventFileChain(utl::Branch &branch)
static std::map< std::string, std::string > fgXMLDictionary
std::vector< std::string > FileContainer
Class representing a document branch.
Definition: Branch.h:107
Status
Return code for seek operation.
Definition: IoCodes.h:24
data-format of SELFAS
Definition: IoCodes.h:52
static void InitXMLDictionary()
utl::Branch fBranch
void SetFileList(const std::vector< std::string > &filenames)
EventFileChain & operator=(const EventFileChain &eventFileChain)
Type GetFileType() const
A collection of EventFile.
Interface to file I/O objects.
Definition: EventFile.h:34
EventFile * fOpenFile
void SetIgnoreExceptions(const bool ignore)
EventFileChain(const Type type)
Type
The type of file that we are acutally opening.
Definition: IoCodes.h:33

, generated on Tue Sep 26 2023.