1 #ifndef __JDB_JSONSUPPORTKIT__
2 #define __JDB_JSONSUPPORTKIT__
9 #include "TDictionary.h"
23 namespace JDATABASE {}
24 namespace JPP {
using namespace JDATABASE; }
42 virtual void to_json(
json& js,
const void* p)
const = 0;
70 public std::map< std::string, std::shared_ptr<JSonIO> >,
89 for_each<JRemove<JPrimitiveTypes_t, JTypeList<char, long double> >::typelist>(*this);
107 const TDictionary* pDictionary = TDictionary::GetDictionary(
typeid(
T));
109 if (pDictionary != NULL)
110 return pDictionary->GetName();
123 (*this)[getTypename<T>()] = std::make_shared<
JSonIO_t<T> >();
146 for (unique_ptr<TIterator> i(cls.
getClass()->GetListOfDataMembers()->MakeIterator());
const TDataMember* p = (
const TDataMember*) i->Next(); ) {
171 for (unique_ptr<TIterator> i(cls.
getClass()->GetListOfDataMembers()->MakeIterator());
const TDataMember* p = (
const TDataMember*) i->Next(); ) {
static const char * getTypename()
Get typename for given template class.
virtual void to_json(json &js, const void *p) const override
ROOT class for reading object.
JSonDictionary()
Default constructor.
friend void to_json(json &js, const T &object)
Convert object to JSon.
virtual void from_json(const json &js, void *p) const override
friend void from_json(const json &js, T &object)
Convert JSon to object/.
const char * getTypename() const
Get type name.
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Auxiliary class for a type holder.
Assigment implementation.
virtual void from_json(const json &js, void *p) const =0
Auxiliary base class for JSon I/O based on ROOT dictionary.
pointer_type getAddress() const
Get address.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
void operator()(const JLANG::JType< T > &type)
Add data type.
JRootAddressableClass get(const TDataMember &data_member) const
Get addressable class of given data member.
Type list of primitive data types.
TClass * getClass() const
Get class.
static data_type & getInstance()
Get unique instance of template class.
virtual void to_json(json &js, const void *p) const =0
static bool is_static(const TDataMember &data_member)
Check if data member is static.
ROOT class for writing object.