Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
JAANET::JAAnetDictionary Class Reference

Simple wrapper class around JROOT::JRootDictionary so that other classes could be included in this dictionary if necessary. More...

#include <JHeadToolkit.hh>

Inheritance diagram for JAANET::JAAnetDictionary:
JROOT::JRootDictionary std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > JLANG::JSingleton< T >

Public Types

typedef T data_type
 

Public Member Functions

template<class T >
void add ()
 Add ASCII I/O for given (list of) class(es) to dictionary. More...
 

Static Public Member Functions

static JRootDictionarygetInstance ()
 Get reference to unique instance of this class object. More...
 
template<class T >
static const char * getTypename ()
 Get typename for given template class. More...
 

Protected Member Functions

template<class T >
void add (const JType< T > &type)
 Addition of class. More...
 
template<class JElement_t , class JAllocator_t >
void add (const JType< std::vector< JElement_t, JAllocator_t > > &type)
 Addition of std::vector. More...
 
template<class JHead_t , class JTail_t >
void add (const JType< JTypeList< JHead_t, JTail_t > > &typelist)
 Recursive addition of classes. More...
 
void add (const JType< JNullType > &type)
 Template specialisation to terminate addition of classes. More...
 

Private Member Functions

 JAAnetDictionary ()
 Default constructor. More...
 

Detailed Description

Simple wrapper class around JROOT::JRootDictionary so that other classes could be included in this dictionary if necessary.

Definition at line 285 of file JHeadToolkit.hh.

Member Typedef Documentation

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

Definition at line 20 of file JSingleton.hh.

Constructor & Destructor Documentation

JAANET::JAAnetDictionary::JAAnetDictionary ( )
inlineprivate

Default constructor.

Definition at line 292 of file JHeadToolkit.hh.

292  :
294  {
295  add<Vec>();
296  add< std::vector<JAANET::physics> >();
297  }
JRootDictionary()
Default constructor.
static data_type & getInstance()
Get unique instance of template class.
Definition: JSingleton.hh:27

Member Function Documentation

static JRootDictionary& JAANET::JAAnetDictionary::getInstance ( )
inlinestatic

Get reference to unique instance of this class object.

This JROOT::JRootDictionary object includes the various Monte Carlo data types.

Returns
reference to this class object

Definition at line 307 of file JHeadToolkit.hh.

308  {
309  static JAAnetDictionary dictionary;
310 
311  return dictionary;
312  }
JAAnetDictionary()
Default constructor.
template<class T >
static const char* JROOT::JRootDictionary::getTypename ( )
inlinestaticinherited

Get typename for given template class.

This method uses the TDictionary class to get the name of the given class.

Returns
type name

Definition at line 99 of file JRootDictionary.hh.

100  {
101  const TDictionary* pDictionary = TDictionary::GetDictionary(typeid(T));
102 
103  if (pDictionary != NULL)
104  return pDictionary->GetName();
105  else
106  throw JException("Error at getTypename(): data type not implemented.");
107  }
template<class T >
void JROOT::JRootDictionary::add ( )
inlineinherited

Add ASCII I/O for given (list of) class(es) to dictionary.

Definition at line 114 of file JRootDictionary.hh.

115  {
116  add(JType<T>());
117  }
void add()
Add ASCII I/O for given (list of) class(es) to dictionary.
template<class T >
void JROOT::JRootDictionary::add ( const JType< T > &  type)
inlineprotectedinherited

Addition of class.

Parameters
typedata type

Definition at line 127 of file JRootDictionary.hh.

128  {
129  this->insert(value_type(getTypename<T>(), new JObjectStreamer<T>()));
130 
131  try {
132  this->insert(value_type(getTypename< std::vector<T> >(), new JObjectStreamer< std::vector<T> >()));
133  }
134  catch(const JException& error) {};
135  }
JObjectStreamer class.
static const char * getTypename()
Get typename for given template class.
template<class JElement_t , class JAllocator_t >
void JROOT::JRootDictionary::add ( const JType< std::vector< JElement_t, JAllocator_t > > &  type)
inlineprotectedinherited

Addition of std::vector.

Parameters
typedata type

Definition at line 144 of file JRootDictionary.hh.

145  {
147 
148  this->insert(value_type(getTypename<data_type>(), new JObjectStreamer<data_type>()));
149  }
JObjectStreamer class.
template<class JHead_t , class JTail_t >
void JROOT::JRootDictionary::add ( const JType< JTypeList< JHead_t, JTail_t > > &  typelist)
inlineprotectedinherited

Recursive addition of classes.

Parameters
typelisttype list

Definition at line 158 of file JRootDictionary.hh.

159  {
160  add(JType<JHead_t>());
161  add(JType<JTail_t>());
162  }
void add()
Add ASCII I/O for given (list of) class(es) to dictionary.
void JROOT::JRootDictionary::add ( const JType< JNullType > &  type)
inlineprotectedinherited

Template specialisation to terminate addition of classes.

Parameters
typenull type

Definition at line 170 of file JRootDictionary.hh.

171  {}

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