Auxiliary base class for JSon I/O based on ROOT dictionary.
More...
#include <JSonSupportkit.hh>
template<class T>
struct JDATABASE::JSonHelper< T >
Auxiliary base class for JSon I/O based on ROOT dictionary.
Definition at line 164 of file JSonSupportkit.hh.
template<class T>
void to_json |
( |
json & |
js, |
|
|
const T & |
object |
|
) |
| |
|
friend |
Convert object to JSon.
- Parameters
-
Definition at line 171 of file JSonSupportkit.hh.
176 JRootWritableClass cls(
object);
178 for (unique_ptr<TIterator> i(cls.getClass()->GetListOfDataMembers()->MakeIterator());
const TDataMember* p = (
const TDataMember*) i->Next(); ) {
180 if (!JRootClass::is_static(*p)) {
182 JRootWritableClass abc = cls.get(*p);
static data_type & getInstance()
Get unique instance of template class.
template<class T>
void from_json |
( |
const json & |
js, |
|
|
T & |
object |
|
) |
| |
|
friend |
Convert JSon to object/.
- Parameters
-
Definition at line 196 of file JSonSupportkit.hh.
201 JRootReadableClass cls(
object);
203 for (unique_ptr<TIterator> i(cls.getClass()->GetListOfDataMembers()->MakeIterator());
const TDataMember* p = (
const TDataMember*) i->Next(); ) {
205 if (!JRootClass::is_static(*p)) {
207 JRootReadableClass abc = cls.get(*p);
209 if (js.contains(p->GetName()))
212 THROW(JParserException,
"No key word <" << p->GetName() <<
"> in " << js);
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
static data_type & getInstance()
Get unique instance of template class.
The documentation for this struct was generated from the following file: