1 #ifndef __JDB_JSONSUPPORTKIT__
2 #define __JDB_JSONSUPPORTKIT__
11 #include "TDictionary.h"
48 js =
json(
static_cast<const std::string&
>(
object));
60 static_cast<std::string&
>(object) = js.get<std::string>();
100 public std::map< std::string, std::shared_ptr<JSonIO> >,
120 for_each<JRemove<JPrimitiveTypes_t, JTypeList<char, long double> >::typelist>(*this);
139 const TDictionary* pDictionary = TDictionary::GetDictionary(
typeid(T));
141 if (pDictionary != NULL)
142 return pDictionary->GetName();
155 (*this)[getTypename<T>()] = std::make_shared< JSonIO_t<T> >();
178 for (unique_ptr<TIterator> i(cls.
getClass()->GetListOfDataMembers()->MakeIterator());
const TDataMember* p = (
const TDataMember*) i->Next(); ) {
203 for (unique_ptr<TIterator> i(cls.
getClass()->GetListOfDataMembers()->MakeIterator());
const TDataMember* p = (
const TDataMember*) i->Next(); ) {
209 if (js.contains(p->GetName()))
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Type list of primitive data types.
Exception when parsing a value.
Auxiliary classes and methods for database I/O.
void from_json(const json &js, JDBString &object)
Convert JSon to database string.
void to_json(json &js, const JDBString &object)
Convert database string to JSon.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Wrapper class to read string until end-of-line.
void operator()(const JLANG::JType< T > &type)
Add data type.
JSonDictionary()
Default constructor.
static const char * getTypename()
Get typename for given template class.
Auxiliary base class for JSon I/O based on ROOT dictionary.
friend void to_json(json &js, const T &object)
Convert object to JSon.
friend void from_json(const json &js, T &object)
Convert JSon to object/.
Assigment implementation.
virtual void to_json(json &js, const void *p) const override
virtual void from_json(const json &js, void *p) const override
virtual void to_json(json &js, const void *p) const =0
virtual void from_json(const json &js, void *p) const =0
static data_type & getInstance()
Get unique instance of template class.
Auxiliary class for a type holder.
pointer_type getAddress() const
Get address.
JRootAddressableClass get(const TDataMember &data_member) const
Get addressable class of given data member.
static bool is_static(const TDataMember &data_member)
Check if data member is static.
TClass * getClass() const
Get class.
const char * getTypename() const
Get type name.
ROOT class for reading object.
ROOT class for writing object.