Jpp 19.3.0-rc.1
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 operator() (const JType< T > &type)
 Addition of class.
 
template<class T >
void add ()
 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 40 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.

This constructor builds a default dictionary which includes all primitive data types and std::vector thereof.

Removed types:

  • long double (not supported by ROOT TDictionary)

Added STL type definitions:

  • std::string
  • std::size_t

Added ROOT type definitions:

  • [U]Char_t
  • [U]Short_t
  • [U]Int_t
  • [U]Long64_t
  • [U]Float_t
  • [U]Double_t

Definition at line 65 of file JRootDictionary.hh.

65 :
66 JRootDictionary_t()
67 {
68#define VALUE_TYPE(__TYPE__) value_type(#__TYPE__, new JObjectStreamer<__TYPE__>())
69
70 using namespace JPP;
71
73
74 (*this)(JType<std::string>());
75 (*this)(JType<std::size_t>());
76
77 this->insert(VALUE_TYPE(Char_t));
78 this->insert(VALUE_TYPE(UChar_t));
79 this->insert(VALUE_TYPE(Short_t));
80 this->insert(VALUE_TYPE(UShort_t));
81 this->insert(VALUE_TYPE(Int_t));
82 this->insert(VALUE_TYPE(UInt_t));
83 this->insert(VALUE_TYPE(Long_t));
84 this->insert(VALUE_TYPE(ULong_t));
85 this->insert(VALUE_TYPE(Long64_t));
86 this->insert(VALUE_TYPE(ULong64_t));
87 this->insert(VALUE_TYPE(Float_t));
88 this->insert(VALUE_TYPE(Double_t));
89
90#undef VALUE_TYPE
91 }
#define VALUE_TYPE(__TYPE__)
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Removal of data type from type list.
Definition JTypeList.hh:114
Auxiliary class for a type holder.
Definition JType.hh:19

Member Function Documentation

◆ operator()()

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

Addition of class.

Parameters
typedata type

Definition at line 99 of file JRootDictionary.hh.

100 {
101 this->insert(value_type(JRoot::getTypename<T>(), new JObjectStreamer<T>()));
102
103 try {
104 this->insert(value_type(JRoot::getTypename< std::vector<T> >(), new JObjectStreamer< std::vector<T> >()));
105 }
106 catch(const JException& error) {};
107 }
static const char * getTypename()
Get ROOT typename for given template class.
Definition JRoot.hh:138

◆ add()

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

Addition of class.

Definition at line 113 of file JRootDictionary.hh.

114 {
115 (*this)(JType<T>());
116 }

◆ 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: