#ifndef __JSUPPORT__JAUTOTREESCANNER__ #define __JSUPPORT__JAUTOTREESCANNER__ #include #include "JLang/JType.hh" #include "JLang/JNullType.hh" #include "JLang/JSinglePointer.hh" #include "JROOT/JROOTClassSelector.hh" #include "JTools/JAutoMap.hh" #include "JSupport/JTreeScanner.hh" /** * \author mdejong */ namespace JSUPPORT {} namespace JPP { using namespace JSUPPORT; } namespace JSUPPORT { using JLANG::JType; using JLANG::JNullType; using JLANG::JSinglePointer; using JROOT::JROOTClassSelector; using JTOOLS::JAutoMap; /** * Auxiliary class to select JTreeScanner based on ROOT class name. */ template struct JAutoTreeScanner : public JAutoMap > > { typedef typename JAutoMap > >::map_type map_type; typedef typename JAutoMap > >::value_type value_type; typedef typename map_type::const_iterator const_iterator; typedef typename map_type::iterator iterator; typedef typename map_type::const_reverse_iterator const_reverse_iterator; typedef typename map_type::reverse_iterator reverse_iterator; using typename JAutoMap > >::insert; /** * Default constructor. */ JAutoTreeScanner() {} /** * Constructor. * * \param type data type */ template JAutoTreeScanner(JType type) { this->insert(); } /** * Insert list of data types. */ template void insert() { this->insert(JTOOLS::JAutomate()); } protected: /** * Auxiliary class for element insertion. */ struct JElement_t : public value_type { /** * Constructor. * * \param type data type */ template JElement_t(JType type) : value_type(JROOTClassSelector(JType()), new JTreeScanner, JEvaluator_t>()) {} }; }; } #endif