#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 JAutoMap > >::insert; /** * Default constructor. */ JAutoTreeScanner() {} /** * Constructor. * * \param type data type * \param option include namespace */ template JAutoTreeScanner(JType type, const bool option = false) : option(option) { this->template insert(); } /** * Get option to include name space. * * \return option */ bool getOption() const { return option; } /** * Insert list of data types. */ template void insert() { using namespace JPP; if (option) this->insert(JAutomate< JElement_t >()); else this->insert(JAutomate< JElement_t >()); } private: /** * Auxiliary class for element insertion. */ template struct JElement_t : public value_type { /** * Constructor. * * \param type data type */ template JElement_t(JType type) : value_type(JROOTClassSelector(type, option), new JTreeScanner, JEvaluator_t>()) {} }; bool option; //!< include namespace }; } #endif