Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JROOT::JRootDictionary Class Reference

Default implementation of ROOT based dictionary for ASCII I/O. More...

#include <JRootDictionary.hh>

Inheritance diagram for JROOT::JRootDictionary:
JROOT::JRootDictionary_t JLANG::JSingleton< T > std::map< std::string, std::shared_ptr< JROOT::JAbstractStreamer > >

Public Types

typedef T data_type
 

Public Member Functions

 JRootDictionary ()
 Default constructor.
 
template<class T >
void add ()
 Addition of class and container classes.
 
template<class T >
void operator() (const JType< T > &type)
 Addition of class.
 
template<class T >
void operator() (const char *const name, const JType< T > &type)
 Addition of class.
 

Static Public Member Functions

static data_typegetInstance ()
 Get unique instance of template class.
 

Detailed Description

Default implementation of ROOT based dictionary for ASCII I/O.

Definition at line 35 of file JRootDictionary.hh.

Member Typedef Documentation

◆ data_type

template<class T >
T JLANG::JSingleton< T >::data_type
inherited

Definition at line 20 of file JSingleton.hh.

Constructor & Destructor Documentation

◆ JRootDictionary()

JROOT::JRootDictionary::JRootDictionary ( )
inline

Default constructor.

Definition at line 43 of file JRootDictionary.hh.

43 :
44 JRootDictionary_t()
45 {
46 handler(*this);
47 }
void handler(JType_t &object)
Apply ROOT types handler to given object.

Member Function Documentation

◆ add()

template<class T >
void JROOT::JRootDictionary::add ( )
inline

Addition of class and container classes.

Definition at line 54 of file JRootDictionary.hh.

55 {
56 using namespace JPP;
57
58 for_each<typename JTYPELIST< T, std::vector<T> >::typelist>(*this);
59 }
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).

◆ operator()() [1/2]

template<class T >
void JROOT::JRootDictionary::operator() ( const JType< T > & type)
inline

Addition of class.

Parameters
typedata type

Definition at line 68 of file JRootDictionary.hh.

69 {
70 const TDictionary* pDictionary = TDictionary::GetDictionary(typeid(T));
71
72 if (pDictionary != NULL)
73 (*this)(pDictionary->GetName(), type);
74 else
75 THROW(JException, "ROOT TDictionary unknown data type.");
76 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.

◆ operator()() [2/2]

template<class T >
void JROOT::JRootDictionary::operator() ( const char *const name,
const JType< T > & type )
inline

Addition of class.

Parameters
namedata name
typedata type

Definition at line 86 of file JRootDictionary.hh.

87 {
88 this->insert(value_type(name, new JObjectStreamer<T>()));
89 }

◆ getInstance()

template<class T >
static data_type & JLANG::JSingleton< T >::getInstance ( )
inlinestaticinherited

Get unique instance of template class.

Returns
object

Definition at line 27 of file JSingleton.hh.

28 {
29 static data_type value;
30
31 return value;
32 }

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