1 #ifndef __JROOT__JROOTCLASS__ 
    2 #define __JROOT__JROOTCLASS__ 
    9 #include <TDictionary.h> 
   11 #include <TDataMember.h> 
   12 #include <TBaseClass.h> 
   13 #include <TIterator.h> 
   26 namespace JPP { 
using namespace JROOT; }
 
   47     static inline bool is_class(
const char* 
const class_name)
 
   49       return (class_name                                      != NULL  &&
 
   50               strcmp(class_name, TClass ::Class()->GetName()) != 0     &&
 
   51               strcmp(class_name, TObject::Class()->GetName()) != 0     &&
 
   52               strcmp(class_name, 
"fgIsA")                     != 0     &&
 
   53               strcmp(class_name, 
"atomic<TClass*>")           != 0);
 
   63     static inline bool is_class(
const TBaseClass& base_class)
 
   65       return is_class(base_class.GetName());
 
   75     static inline bool is_class(
const TDataMember& data_member)
 
   77       return is_class(data_member.GetTypeName());
 
   89       return (const_cast<TBaseClass&>(base_class).IsSTLContainer() != ROOT::kNotSTL);
 
  101       return (const_cast<TDataMember&>(data_member).IsSTLContainer() != ROOT::kNotSTL);
 
  113       return (strcmp(data_member.GetFullTypeName(), 
"string")       == 0 ||
 
  114               strcmp(data_member.GetFullTypeName(), 
"const string") == 0);
 
  124     static inline bool is_static(
const TDataMember& data_member)
 
  126       return (data_member.Property() & kIsStatic);
 
  135     template<
class JType_t>
 
  137       dictionary(TDictionary::GetDictionary(typeid(JType_t))),
 
  147     template<
class JType_t, 
class JClass_t>
 
  149       dictionary(TDictionary::GetDictionary(typeid(JType_t))),
 
  150       offset((char*) &(((JClass_t*) NULL)->*pd) - (char*) NULL)
 
  233       if (name != NULL && strlen(name) != 0) {
 
  243           const TDataMember* p = this->
getClass()->GetDataMember(name);
 
  246             return this->
get(*p);
 
  251           TIterator* i = this->
getClass()->GetListOfBases()->MakeIterator();
 
  253           for (TBaseClass* p; (p = (TBaseClass*) i->Next()) != NULL; ) {
 
  259               rcs = rcs.
find(name);
 
  280       return JRootClass(TDictionary::GetDictionary(data_member.GetTypeName()), 
 
  281                         this->
getOffset() + data_member.GetOffset());
 
  292       return JRootClass(TDictionary::GetDictionary(base_class.GetName()),
 
  293                         this->
getOffset() + 
const_cast<TBaseClass&
>(base_class).GetDelta());
 
  302     inline void print(std::ostream& out)
 const 
  331       dictionary(dictionary),
 
  342     inline void print(std::ostream& out, 
const std::string& prefix)
 const 
  350           if (this->
getClass()->GetListOfBases() != NULL) {
 
  352             TIterator* i = this->
getClass()->GetListOfBases()->MakeIterator();
 
  354             for (
const TBaseClass* p; (p = (
const TBaseClass*) i->Next()) != NULL; ) {
 
  356                 this->
get(*p).print(out, prefix + 
"::" + p->GetName());
 
  358                 print(out, prefix + 
"::" + p->GetName(), this->
get(*p).getTypename());
 
  362           if (this->
getClass()->GetListOfDataMembers() != NULL) {
 
  364             TIterator* i = this->
getClass()->GetListOfDataMembers()->MakeIterator();
 
  366             for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
 
  368                 this->
get(*p).print(out, prefix + (
is_static(*p) ?  
"::" : 
".") + p->GetName());
 
  370                 print(out, prefix + (
is_static(*p) ?  
"::" : 
".") + p->GetName(), this->
get(*p).getTypename());
 
  385     inline static void print(std::ostream& out, 
const std::string& 
name, 
const std::string& type) 
 
  389       out << name << 
"  " << 
'(' << type << 
')' << endl;
 
  397   template<
class JPo
inter_t>
 
  423   template<
class JPo
inter_t>
 
  505       return this->
find(name);
 
  556     operator const T&() 
const 
  559         return * (
const T*) this->getAddress();
 
  575         return * (
T*) this->getAddress();
 
  616     operator const T&() 
const 
  619         return * (
const T*) this->getAddress();
 
  641       i = parent.
getClass()->GetListOfDataMembers()->MakeIterator();
 
  643       for (
const TDataMember* p; (p = (
const TDataMember*) i->Next()) != NULL; ) {
 
  652       i = parent.
getClass()->GetListOfBases()->MakeIterator();
 
  654       for (
const TBaseClass* p; (p = (
const TBaseClass*) i->Next()) != NULL; ) {
 
  677   template<
class JType_t, 
class JClass_t>
 
void print(std::ostream &out, const std::string &prefix) const 
Print ROOT class information. 
 
ROOT class for reading object. 
 
JRootAddressableClass find(const char *name) const 
Find addressable base class or data member with given name within current class. 
 
JAddress_t::pointer_type pointer_type
 
int getOffset() const 
Get offset of this class with respect to parent class. 
 
JRootAddressableClass(const JRootClass &rc, pointer_type address)
Constructor. 
 
JRootClass(JType_t JClass_t::*pd)
Constructor. 
 
const TDataMember * getDataMember(const JRootClass &parent, const JRootClass &member)
Get ROOT data member for given parent and member class. 
 
static bool is_STLcontainer(const TBaseClass &base_class)
Check if base class is STL container. 
 
void print(std::ostream &out) const 
Print ROOT class information. 
 
JRootClass(const JType< JType_t > &type)
Constructor. 
 
static bool is_class(const char *const class_name)
Check class name against ROOT class names. 
 
const char * getTypename() const 
Get type name. 
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message. 
 
JRootClass()
Default constructor. 
 
JRootAddressableClass(T &object)
Constructor. 
 
JRootWritableClass(const JRootAddressableClass< const char * > &rc)
Copy constructor. 
 
Auxiliary class for a type holder. 
 
static bool is_STLcontainer(const TDataMember &data_member)
Check if data member is STL container. 
 
JRootWritableClass(const T &object)
Constructor. 
 
Auxiliary class to manage access to base classes and data members of ROOT class objects. 
 
static bool is_STLstring(const TDataMember &data_member)
Check if data member is STL string. 
 
JRootClass get(const TDataMember &data_member) const 
Get ROOT class of given data member. 
 
JRootAddressableClass operator[](const char *name) const 
Find addressable base class or data member with given name within current class. 
 
TDictionary * getDictionary() const 
Get dictionary. 
 
static bool is_class(const TBaseClass &base_class)
Check base class against ROOT class names. 
 
pointer_type getAddress() const 
Get address. 
 
do set_variable OUTPUT_DIRECTORY $WORKDIR T
 
Template definition of auxiliary base class for comparison of data structures. 
 
bool equals(const JRootClass &object) const 
Test equality of ROOT classes. 
 
bool is_valid() const 
Check validity of this class. 
 
JRootReadableClass(T &object)
Constructor. 
 
static void print(std::ostream &out, const std::string &name, const std::string &type)
Print ROOT class information. 
 
Exception for cast operation. 
 
TDictionary * dictionary
pointer to ROOT dictionary 
 
JPointer_t pointer_type
Type definition of address. 
 
bool is_valid() const 
Check validity of this addressable class. 
 
JAddress< JPointer_t > JAddress_t
 
static bool is_class(const TDataMember &data_member)
Check data member against ROOT class names. 
 
TClass * getClass() const 
Get class. 
 
JAddress(pointer_type p)
Constructor. 
 
JType< T > getType()
Get type. 
 
JRootClass(TDictionary *dictionary, int offset)
Constructor. 
 
Auxiliary class to manage access to base classes and data members of ROOT class. 
 
JRootClass find(const char *name) const 
Find base class or data member with given name within current class. 
 
int offset
offset with respect to data structure [B] 
 
JRootReadableClass(const JRootAddressableClass< char * > &rc)
Copy constructor. 
 
static bool is_static(const TDataMember &data_member)
Check if data member is static. 
 
ROOT class for writing object.