yoda is hosted by Hepforge, IPPP Durham
YODA - Yet more Objects for Data Analysis 2.0.2
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 124 of file ReaderUtils.h.

124{ }

◆ ~AOReaderBase()

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

Default destructor.

Definition at line 127 of file ReaderUtils.h.

127{ }

Member Function Documentation

◆ assemble()

◆ extractVector()

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

Definition at line 134 of file ReaderUtils.h.

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

References aiss.

◆ parse()

Member Data Documentation

◆ aiss

aistringstream YODA::AOReaderBase::aiss
protected

Definition at line 161 of file ReaderUtils.h.

Referenced by extractVector().


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