Auxiliary class to manage access to base classes and data members of ROOT class.  
 More...
#include <JRootClass.hh>
 | 
| static bool  | is_class (const char *const name) | 
|   | Check name of class against ROOT classes.  More...
  | 
|   | 
| static bool  | is_class (const TBaseClass &base_class) | 
|   | Check base class against ROOT class names.  More...
  | 
|   | 
| static bool  | is_class (const TDataMember &data_member) | 
|   | Check data member against ROOT class names.  More...
  | 
|   | 
| static bool  | is_STLcontainer (const TBaseClass &base_class) | 
|   | Check if base class is STL container.  More...
  | 
|   | 
| static bool  | is_STLcontainer (const TDataMember &data_member) | 
|   | Check if data member is STL container.  More...
  | 
|   | 
| static bool  | is_STLstring (const TDataMember &data_member) | 
|   | Check if data member is STL string.  More...
  | 
|   | 
| static bool  | is_static (const TDataMember &data_member) | 
|   | Check if data member is static.  More...
  | 
|   | 
| static bool  | is_tobject_member (const char *name) | 
|   | Check if name is one of TObject own data members (fBits or fUniqueID, for Root <= 6.30.04 at least)  More...
  | 
|   | 
 | 
| static void  | print (std::ostream &out, const std::string &name, const std::string &type) | 
|   | Print ROOT class information.  More...
  | 
|   | 
Auxiliary class to manage access to base classes and data members of ROOT class. 
Definition at line 41 of file JRootClass.hh.
 
◆ JRootClass() [1/4]
template<class JType_t > 
  
  
      
        
          | JROOT::JRootClass::JRootClass  | 
          ( | 
          const JType< JType_t > &  | 
          type | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
  
 
Definition at line 149 of file JRootClass.hh.
  150       dictionary(TDictionary::GetDictionary(
typeid(JType_t))),
 
TDictionary * dictionary
pointer to ROOT dictionary
 
int offset
offset with respect to data structure [B]
 
 
 
 
◆ JRootClass() [2/4]
template<class JType_t , class JClass_t > 
  
  
      
        
          | JROOT::JRootClass::JRootClass  | 
          ( | 
          JType_t JClass_t::*  | 
          pd | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
    | pd | pointer to C++ data member  | 
  
   
Definition at line 161 of file JRootClass.hh.
  162       dictionary(TDictionary::GetDictionary(
typeid(JType_t))),
 
  163       offset((
char*) &(((JClass_t*) NULL)->*pd) - (
char*) NULL)
 
 
 
 
◆ JRootClass() [3/4]
  
  
      
        
          | JROOT::JRootClass::JRootClass  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlineprotected   | 
  
 
 
◆ JRootClass() [4/4]
  
  
      
        
          | JROOT::JRootClass::JRootClass  | 
          ( | 
          TDictionary *  | 
          dictionary,  | 
         
        
           | 
           | 
          int  | 
          offset  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlineprotected   | 
  
 
Constructor. 
- Parameters
 - 
  
    | dictionary | pointer to dictionary  | 
    | offset | offset  | 
  
   
Definition at line 345 of file JRootClass.hh.
 
 
◆ is_class() [1/3]
  
  
      
        
          | static bool JROOT::JRootClass::is_class  | 
          ( | 
          const char *const  | 
          name | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Check name of class against ROOT classes. 
- Parameters
 - 
  
  
 
- Returns
 - true if name of class corresponds to genuine class; else false 
 
Definition at line 50 of file JRootClass.hh.
   52       return (name                                      != NULL  &&
 
   53               strcmp(name, TClass ::Class()->GetName()) != 0     &&
 
   54               strcmp(name, TObject::Class()->GetName()) != 0     &&
 
   55               strcmp(name, 
"_Rb_tree_node_base")        != 0     &&
 
   56               strcmp(name, 
"fgIsA")                     != 0     &&
 
   57               strcmp(name, 
"atomic<TClass*>")           != 0);
 
 
 
 
◆ is_class() [2/3]
  
  
      
        
          | static bool JROOT::JRootClass::is_class  | 
          ( | 
          const TBaseClass &  | 
          base_class | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Check base class against ROOT class names. 
- Parameters
 - 
  
  
 
- Returns
 - true if valid class name; else false 
 
Definition at line 67 of file JRootClass.hh.
   69       return is_class(base_class.GetName());
 
static bool is_class(const char *const name)
Check name of class against ROOT classes.
 
 
 
 
◆ is_class() [3/3]
  
  
      
        
          | static bool JROOT::JRootClass::is_class  | 
          ( | 
          const TDataMember &  | 
          data_member | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Check data member against ROOT class names. 
- Parameters
 - 
  
  
 
- Returns
 - true if valid class name; else false 
 
Definition at line 79 of file JRootClass.hh.
   81       return is_class(data_member.GetTypeName());
 
 
 
 
◆ is_STLcontainer() [1/2]
  
  
      
        
          | static bool JROOT::JRootClass::is_STLcontainer  | 
          ( | 
          const TBaseClass &  | 
          base_class | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Check if base class is STL container. 
- Parameters
 - 
  
  
 
- Returns
 - true if STL congtainer; else false 
 
Definition at line 91 of file JRootClass.hh.
   93       return (
const_cast<TBaseClass&
>(base_class).IsSTLContainer() != ROOT::kNotSTL);
 
 
 
 
◆ is_STLcontainer() [2/2]
  
  
      
        
          | static bool JROOT::JRootClass::is_STLcontainer  | 
          ( | 
          const TDataMember &  | 
          data_member | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Check if data member is STL container. 
- Parameters
 - 
  
  
 
- Returns
 - true if STL congtainer; else false 
 
Definition at line 103 of file JRootClass.hh.
  105       return (
const_cast<TDataMember&
>(data_member).IsSTLContainer() != ROOT::kNotSTL);
 
 
 
 
◆ is_STLstring()
  
  
      
        
          | static bool JROOT::JRootClass::is_STLstring  | 
          ( | 
          const TDataMember &  | 
          data_member | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Check if data member is STL string. 
- Parameters
 - 
  
  
 
- Returns
 - true if STL string; else false 
 
Definition at line 115 of file JRootClass.hh.
  117       return (strcmp(data_member.GetFullTypeName(), 
"string")       == 0 ||
 
  118               strcmp(data_member.GetFullTypeName(), 
"const string") == 0);
 
 
 
 
◆ is_static()
  
  
      
        
          | static bool JROOT::JRootClass::is_static  | 
          ( | 
          const TDataMember &  | 
          data_member | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Check if data member is static. 
- Parameters
 - 
  
  
 
- Returns
 - true if static; else false 
 
Definition at line 128 of file JRootClass.hh.
  130       return (data_member.Property() & kIsStatic);
 
 
 
 
◆ is_tobject_member()
  
  
      
        
          | static bool JROOT::JRootClass::is_tobject_member  | 
          ( | 
          const char *  | 
          name | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Check if name is one of TObject own data members (fBits or fUniqueID, for Root <= 6.30.04 at least) 
Definition at line 138 of file JRootClass.hh.
  140       TClass* o_class = TClass::GetClass<TObject>();
 
  141       return o_class->GetListOfRealData()->FindObject(name) != 
nullptr;
 
 
 
 
◆ getDictionary()
  
  
      
        
          | TDictionary* JROOT::JRootClass::getDictionary  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get dictionary. 
- Returns
 - pointer to dictionary 
 
Definition at line 172 of file JRootClass.hh.
 
 
◆ getOffset()
  
  
      
        
          | int JROOT::JRootClass::getOffset  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get offset of this class with respect to parent class. 
- Returns
 - offset 
 
Definition at line 183 of file JRootClass.hh.
 
 
◆ getClass()
  
  
      
        
          | TClass* JROOT::JRootClass::getClass  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get class. 
- Returns
 - pointer to class 
 
Definition at line 194 of file JRootClass.hh.
 
 
◆ getTypename()
  
  
      
        
          | const char* JROOT::JRootClass::getTypename  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
 
◆ is_valid()
  
  
      
        
          | bool JROOT::JRootClass::is_valid  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Check validity of this class. 
- Returns
 - true if valid class; else false 
 
Definition at line 219 of file JRootClass.hh.
TDictionary * getDictionary() const
Get dictionary.
 
const char * getTypename() const
Get type name.
 
 
 
 
◆ equals()
  
  
      
        
          | bool JROOT::JRootClass::equals  | 
          ( | 
          const JRootClass &  | 
          object | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Test equality of ROOT classes. 
- Parameters
 - 
  
  
 
- Returns
 - true if both ROOT classes are same type; else false 
 
Definition at line 231 of file JRootClass.hh.
 
 
◆ find()
  
  
      
        
          | JRootClass JROOT::JRootClass::find  | 
          ( | 
          const char *const  | 
          name,  | 
         
        
           | 
           | 
          const bool  | 
          option = true  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inline   | 
  
 
Find base class or data member with given name within current class. 
- Parameters
 - 
  
    | name | name of base class or data member  | 
    | option | case sensitivity  | 
  
   
- Returns
 - ROOT class 
 
Definition at line 246 of file JRootClass.hh.
  248       if (name != NULL && strlen(name) != 0) {
 
  258           for (std::unique_ptr<TIterator> i(this->
getClass()->GetListOfDataMembers(kFALSE)->MakeIterator()); 
const TDataMember* p = (
const TDataMember*) i->Next(); ) {
 
  259             if (( option  &&  strcmp    (p->GetName(), name) == 0) ||
 
  260                 (!option  &&  strcasecmp(p->GetName(), name) == 0)) { 
 
  261               return this->
get(*p);
 
  267           for (std::unique_ptr<TIterator> i(this->
getClass()->GetListOfBases()->MakeIterator()); TBaseClass* p = (TBaseClass*) i->Next(); ) {
 
  273               rcs = rcs.
find(name);
 
Auxiliary class to manage access to base classes and data members of ROOT class.
 
bool is_valid() const
Check validity of this class.
 
JRootClass get(const TDataMember &data_member) const
Get ROOT class of given data member.
 
static bool is_STLcontainer(const TBaseClass &base_class)
Check if base class is STL container.
 
JRootClass()
Default constructor.
 
TClass * getClass() const
Get class.
 
JRootClass find(const char *const name, const bool option=true) const
Find base class or data member with given name within current class.
 
 
 
 
◆ get() [1/2]
  
  
      
        
          | JRootClass JROOT::JRootClass::get  | 
          ( | 
          const TDataMember &  | 
          data_member | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get ROOT class of given data member. 
- Parameters
 - 
  
  
 
- Returns
 - ROOT class 
 
Definition at line 293 of file JRootClass.hh.
  295       return JRootClass(TDictionary::GetDictionary(data_member.GetTypeName()), 
 
  296                         this->getOffset() + data_member.GetOffset());
 
 
 
 
◆ get() [2/2]
  
  
      
        
          | JRootClass JROOT::JRootClass::get  | 
          ( | 
          const TBaseClass &  | 
          base_class | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Get ROOT class of given base class. 
- Parameters
 - 
  
  
 
- Returns
 - ROOT class 
 
Definition at line 306 of file JRootClass.hh.
  308       return JRootClass(TDictionary::GetDictionary(base_class.GetName()),
 
  309                         this->getOffset() + 
const_cast<TBaseClass&
>(base_class).GetDelta());
 
 
 
 
◆ print() [1/3]
  
  
      
        
          | void JROOT::JRootClass::print  | 
          ( | 
          std::ostream &  | 
          out | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Print ROOT class information. 
- Parameters
 - 
  
  
 
Definition at line 318 of file JRootClass.hh.
void print(std::ostream &out) const
Print ROOT class information.
 
 
 
 
◆ print() [2/3]
  
  
      
        
          | void JROOT::JRootClass::print  | 
          ( | 
          std::ostream &  | 
          out,  | 
         
        
           | 
           | 
          const std::string &  | 
          prefix  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inlineprotected   | 
  
 
Print ROOT class information. 
- Parameters
 - 
  
    | out | output stream  | 
    | prefix | prefix  | 
  
   
Definition at line 358 of file JRootClass.hh.
  366           if (this->
getClass()->GetListOfBases() != NULL) {
 
  368             for (std::unique_ptr<TIterator> i(this->
getClass()->GetListOfBases()->MakeIterator()); 
const TBaseClass* p = (
const TBaseClass*) i->Next(); ) {
 
  370                 this->
get(*p).
print(out, prefix + 
"::" + p->GetName());
 
  372                 print(out, prefix + 
"::" + p->GetName(), this->get(*p).getTypename());
 
  376           if (this->
getClass()->GetListOfDataMembers(kFALSE) != NULL) {
 
  378             for (std::unique_ptr<TIterator> i(this->
getClass()->GetListOfDataMembers(kFALSE)->MakeIterator()); 
const TDataMember* p = (
const TDataMember*) i->Next(); ) {
 
  382                 print(out, prefix + (
is_static(*p) ?  
"::" : 
".") + p->GetName(), this->get(*p).getTypename());
 
static bool is_static(const TDataMember &data_member)
Check if data member is static.
 
static bool is_STLstring(const TDataMember &data_member)
Check if data member is STL string.
 
 
 
 
◆ print() [3/3]
  
  
      
        
          | static void JROOT::JRootClass::print  | 
          ( | 
          std::ostream &  | 
          out,  | 
         
        
           | 
           | 
          const std::string &  | 
          name,  | 
         
        
           | 
           | 
          const std::string &  | 
          type  | 
         
        
           | 
          ) | 
           |  | 
         
       
   | 
  
inlinestaticprotected   | 
  
 
Print ROOT class information. 
- Parameters
 - 
  
    | out | output stream  | 
    | name | name  | 
    | type | type  | 
  
   
Definition at line 397 of file JRootClass.hh.
  401       out << name << 
"  " << 
'(' << type << 
')' << endl;
 
 
 
 
◆ dictionary
  
  
      
        
          | TDictionary* JROOT::JRootClass::dictionary | 
         
       
   | 
  
protected   | 
  
 
 
◆ offset
  
  
      
        
          | int JROOT::JRootClass::offset | 
         
       
   | 
  
protected   | 
  
 
offset with respect to data structure [B] 
Definition at line 327 of file JRootClass.hh.
 
 
The documentation for this struct was generated from the following file: