Jpp 19.3.0-rc.2
the software that should make you happy
Loading...
Searching...
No Matches
JDATABASE::JSonDictionary Struct Reference

Assignment. More...

#include <JSonSupportkit.hh>

Inheritance diagram for JDATABASE::JSonDictionary:
std::map< std::string, std::shared_ptr< JSonIO > > JLANG::JSingleton< T >

Public Types

typedef T data_type
 

Public Member Functions

 JSonDictionary ()
 Default constructor.
 
template<class T >
void operator() (const JLANG::JType< T > &type)
 Add data type.
 

Static Public Member Functions

template<class T >
static const char * getTypename ()
 Get typename for given template class.
 
static data_typegetInstance ()
 Get unique instance of template class.
 

Detailed Description

Assignment.

Definition at line 100 of file JSonSupportkit.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

◆ JSonDictionary()

JDATABASE::JSonDictionary::JSonDictionary ( )
inline

Default constructor.

Removed types:

  • long double (not supported by ROOT TDictionary)
  • char (not supported by JSon)

Added STL type definitions:

Definition at line 117 of file JSonSupportkit.hh.

118 {
119 using namespace JPP;
120
121 for_each<JRemove<JPrimitiveTypes_t, JTypeList<char, long double> >::typelist>(*this);
122
123 (*this)(JType<std::string>());
124 (*this)(JType<size_t>());
125 (*this)(JType<std::size_t>());
127 }
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class for a type holder.
Definition JType.hh:19

Member Function Documentation

◆ getTypename()

template<class T >
static const char * JDATABASE::JSonDictionary::getTypename ( )
inlinestatic

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 138 of file JSonSupportkit.hh.

139 {
140 const TDictionary* pDictionary = TDictionary::GetDictionary(typeid(T));
141
142 if (pDictionary != NULL)
143 return pDictionary->GetName();
144 else
145 THROW(JException, "Data type not implemented.");
146 }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.

◆ operator()()

template<class T >
void JDATABASE::JSonDictionary::operator() ( const JLANG::JType< T > & type)
inline

Add data type.

Parameters
typedata type

Definition at line 154 of file JSonSupportkit.hh.

155 {
156 (*this)[getTypename<T>()] = std::make_shared< JSonIO_t<T> >();
157 }
static const char * getTypename()
Get typename for given template class.

◆ 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 struct was generated from the following file: