Jpp  19.1.0
the software that should make you happy
Classes | Public Member Functions | Private Attributes | List of all members
JROOT::JDataFrame::JBuffer< T > Struct Template Reference

Auxiliary buffer for parsing data from ROOT data frame. More...

#include <JDataFrame.hh>

Inheritance diagram for JROOT::JDataFrame::JBuffer< T >:
std::vector< T >

Classes

struct  JOutput_t
 Template implementation for output. More...
 

Public Member Functions

 JBuffer ()
 Default constructor. More...
 
size_t operator() (ROOT::RDataFrame &in, const range_type &range)
 Parse data. More...
 

Private Attributes

TClass * cs = NULL
 

Detailed Description

template<class T>
struct JROOT::JDataFrame::JBuffer< T >

Auxiliary buffer for parsing data from ROOT data frame.

Definition at line 189 of file JDataFrame.hh.

Constructor & Destructor Documentation

◆ JBuffer()

template<class T >
JROOT::JDataFrame::JBuffer< T >::JBuffer ( )
inline

Default constructor.

Definition at line 195 of file JDataFrame.hh.

195  :
196  cs(TClass::GetClass<T>())
197  {
198  if (!cs) {
199  THROW(JException, "Data type not defined via ROOT TClass.");
200  }
201  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712

Member Function Documentation

◆ operator()()

template<class T >
size_t JROOT::JDataFrame::JBuffer< T >::operator() ( ROOT::RDataFrame &  in,
const range_type range 
)
inline

Parse data.

Parameters
ininput
rangerange
Returns
number of entries parsed

Definition at line 211 of file JDataFrame.hh.

212  {
213  size_t N = range.getUpperLimit() - range.getLowerLimit();
214 
215  if (N != 0) {
216 
217  this->resize(N);
218 
219  for (const std::string& column : in.GetColumnNames()) {
220 
221  TDataMember* ps = cs->GetDataMember(column.c_str());
222 
223  if (ps != NULL && JDictionary::getInstance().count(ps->GetTypeName()) != 0) {
224 
225  JOutput_t out(*this, ps->GetOffset());
226 
227  N = std::min(N, JDictionary::getInstance()[ps->GetTypeName()]->parse(in, column.c_str(), range, out));
228 
229  } else {
230 
231  THROW(JException, "Data type not implemented for column " << column);
232  }
233  }
234  }
235 
236  return N;
237  }
T getLowerLimit() const
Get lower limit.
Definition: JRange.hh:202
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
static data_type & getInstance()
Get unique instance of template class.
Definition: JSingleton.hh:27

Member Data Documentation

◆ cs

template<class T >
TClass* JROOT::JDataFrame::JBuffer< T >::cs = NULL
private

Definition at line 241 of file JDataFrame.hh.


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