1#ifndef __JROOT__JROOTTYPESHANDLER__
2#define __JROOT__JROOTTYPESHANDLER__
9#include <TDictionary.h>
23namespace JPP {
using namespace JROOT; }
40 template<
class JType_t>
56 virtual void apply(JType_t&
object,
const char*
const name)
const = 0;
71 template<
class JType_t,
class T>
82 virtual void apply(JType_t&
object,
const char*
const name)
const override
113 template<
class JType_t>
115 public std::map<std::string, std::shared_ptr< JAbstractType<JType_t> > >
128 for_each<JTYPELIST<JRemove<JPrimitiveTypes_t, long double>::typelist,
130 std::size_t>::typelist>(*this);
132#define VALUE_TYPE(__TYPE__) typename map_type::value_type(#__TYPE__, new JObjectType<JType_t, __TYPE__>())
164 const TDictionary* pDictionary = TDictionary::GetDictionary(
typeid(T));
166 if (pDictionary != NULL)
167 (*this)(pDictionary->GetName(), type);
169 THROW(
JException,
"ROOT TDictionary unknown data type " <<
typeid(T).name());
193 for (
typename map_type::const_iterator i = this->begin(); i != this->end(); ++i) {
194 i->second->apply(
object, i->first.c_str());
207 template<
class JType_t>
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Type list of primitive data types.
#define VALUE_TYPE(__TYPE__)
Interface for handling of a template class.
virtual void apply(JType_t &object, const char *const name) const =0
Apply type with given name to object.
virtual ~JAbstractType()
Virtual destructor.
Implementation for handling of a template class.
virtual void apply(JType_t &object, const char *const name) const override
Apply type with given name to object.
Auxiliary class for handling ROOT types.
void operator()(const char *const name, const JType< T > &type)
Addition of data type.
void apply(JType_t &object) const
Apply this handler to given object.
JRootTypesHandler()
Default constructor.
void operator()(const JType< T > &type)
Addition of data type.
std::map< std::string, std::shared_ptr< JAbstractType< JType_t > > > map_type
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for ROOT I/O.
void handler(JType_t &object)
Apply ROOT types handler to given object.
Auxiliary class for a type holder.