Jpp master_rocky-44-g75b7c4f75
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 99 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 116 of file JSonSupportkit.hh.

117 {
118 using namespace JPP;
119
120 for_each<JRemove<JPrimitiveTypes_t, JTypeList<char, long double> >::typelist>(*this);
121
122 (*this)(JType<std::string>());
123 (*this)(JType<size_t>());
124 (*this)(JType<std::size_t>());
126 }
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 137 of file JSonSupportkit.hh.

138 {
139 const TDictionary* pDictionary = TDictionary::GetDictionary(typeid(T));
140
141 if (pDictionary != NULL)
142 return pDictionary->GetName();
143 else
144 THROW(JException, "Data type not implemented.");
145 }
#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 153 of file JSonSupportkit.hh.

154 {
155 (*this)[getTypename<T>()] = std::make_shared< JSonIO_t<T> >();
156 }
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: