yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.0
YODA::AOReaderBase Class Referenceabstract

#include <ReaderUtils.h>

Inheritance diagram for YODA::AOReaderBase:
YODA::AOReader< BinnedDbn< DbnN, AxisT... > > YODA::AOReader< BinnedEstimate< AxisT... > > YODA::AOReader< Counter > YODA::AOReader< Estimate0D > YODA::AOReader< ScatterND< N > >

Public Member Functions

 AOReaderBase ()
 Default constructor.
 
virtual ~AOReaderBase ()
 Default destructor.
 
virtual void parse (const string &line)=0
 
virtual AnalysisObjectassemble (const string &path="")=0
 
template<typename T >
void extractVector (const std::string &line, std::vector< T > &vec)
 

Protected Attributes

aistringstream aiss
 

Detailed Description

Definition at line 40 of file ReaderUtils.h.

Constructor & Destructor Documentation

◆ AOReaderBase()

YODA::AOReaderBase::AOReaderBase ( )
inline

Default constructor.

Definition at line 125 of file ReaderUtils.h.

125{ }

◆ ~AOReaderBase()

virtual YODA::AOReaderBase::~AOReaderBase ( )
inlinevirtual

Default destructor.

Definition at line 128 of file ReaderUtils.h.

128{ }

Member Function Documentation

◆ assemble()

◆ extractVector()

template<typename T >
void YODA::AOReaderBase::extractVector ( const std::string &  line,
std::vector< T > &  vec 
)
inline

Definition at line 135 of file ReaderUtils.h.

135 {
136 if constexpr (std::is_same<T, std::string>::value) {
137 string::const_iterator initpos( line.cbegin() );
138 const string::const_iterator finpos( line.cend() );
139 std::smatch m;
140 while ( std::regex_search(initpos, finpos, m, regex_string_pat) ) {
141 string label;
142 std::stringstream ss(m[0].str());
143 ss >> std::quoted(label); // removes outer quotes and de-escapes inner quotes
144 vec.push_back(label);
145 initpos = m.suffix().first;
146 }
147 }
148 else {
149 std::string content = line.substr(line.find(": [")+3);
150 content.pop_back(); // remove the "]" at the end
151 for (const std::string& item : Utils::split(content, ",")) {
152 aiss.reset(item);
153 T tmp;
154 aiss >> tmp;
155 vec.push_back(std::move(tmp));
156 }
157 }
158 }
aistringstream aiss

References aiss.

◆ parse()

Member Data Documentation

◆ aiss

aistringstream YODA::AOReaderBase::aiss
protected

Definition at line 162 of file ReaderUtils.h.

Referenced by extractVector().


The documentation for this class was generated from the following file: