YODA::ReaderH5 Class Reference Persistency reader from YODA text data format. More...
Inheritance diagram for YODA::ReaderH5:
![]()
Detailed DescriptionPersistency reader from YODA text data format. Definition at line 15 of file ReaderH5.h. Constructor & Destructor Documentation◆ ReaderH5() [1/2]
Disable copy and move constructors. ◆ ReaderH5() [2/2]
Member Function Documentation◆ create()
Singleton creation function. Definition at line 28 of file ReaderH5.cc. 28 {
30 _instance.registerDefaultTypes<double,int,string>();
31 return _instance;
32 }
Referenced by YODA::mkReader(). ◆ operator=() [1/2]
Disable copy and move assignments. ◆ operator=() [2/2]
◆ read()
Read in a collection of objects objs from an HDF5 file. This version fills (actually, appends to) a supplied vector, avoiding copying, and is hence CPU efficient. Implements YODA::Reader. Definition at line 78 of file ReaderH5.cc. 79 {
80
81 vector<regex> patterns, unpatterns;
82 for (const string& pat : Utils::split(match, ",")) { patterns.push_back(regex(pat)); }
83 for (const string& pat : Utils::split(unmatch, ",")) { unpatterns.push_back(regex(pat)); }
84
85 // Load edge information
86 H5FileManager reader(file);
87
88 // Prepare registry
89 TypeRegisterItr thisAOR = _register.cend();
91
92 while (reader.next()) {
93
94 // Check that type has been loaded
95 thisAOR = _register.find(reader.type());
96 if (thisAOR == endAOR) {
97 throw ReadError("Unexpected context found: " + reader.type());
98 }
99
100 // Check if path is being (un-)matched
101 //
102 // Since the edge types are not known until run time,
103 // (empty) objects still need to be instantiated
104 // from the type registry in order to be able to
105 // choose the correct set of edges to skip.
107 if (!pattern_pass) {
108 thisAOR->second->skip(reader);
109 continue;
110 }
111
112 // Construct AO
113 aos.push_back(thisAOR->second->mkFromH5(reader));
114 }
115 }
typename std::unordered_map< std::string, std::unique_ptr< AOReaderBase > >::const_iterator TypeRegisterItr Convenience alias for AO Reader. Definition Reader.h:40 bool patternCheck(const std::string &path, const std::vector< std::regex > &patterns, const std::vector< std::regex > &unpatterns) Check if a string matches any of the given patterns, and that it doesn't match any unpatterns (for pa... Definition Reader.h:200 References YODA::H5FileManager::next(), YODA::H5FileManager::path(), YODA::Reader::patternCheck(), and YODA::H5FileManager::type(). The documentation for this class was generated from the following files:
Generated on Fri Mar 7 2025 09:06:41 for YODA - Yet more Objects for Data Analysis by |