Jpp  19.0.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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

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

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
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:712
T getUpperLimit() const
Get upper limit.
Definition: JRange.hh:213
z range($ZMAX-$ZMIN)< $MINIMAL_DZ." fi fi typeset -Z 4 STRING typeset -Z 2 FLOOR JPlot1D -f $
then usage $script< input file >[option[primary[working directory]]] nWhere option can be N
Definition: JMuonPostfit.sh:40
static data_type & getInstance()
Get unique instance of template class.
Definition: JSingleton.hh:27
then fatal The output file must have the wildcard in the e g root fi eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:48

Member Data Documentation

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: