ROOT branch class.  
 More...
#include <JRootTypewriter.hh>
 | 
| void  | print (std::ostream &out, const std::string &prefix) const | 
|   | Print ROOT class information.  
  | 
|   | 
 | 
| static void  | print (std::ostream &out, const std::string &name, const std::string &type) | 
|   | Print ROOT class information.  
  | 
|   | 
 | 
| std::string  | name | 
|   | 
| EDataType  | type = kNoType_t | 
|   | 
ROOT branch class. 
Definition at line 148 of file JRootTypewriter.hh.
 
◆ pointer_type
◆ JBranchClass() [1/3]
  
  
      
        
          | JROOT::JBranchClass::JBranchClass  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Default constructor. 
Definition at line 154 of file JRootTypewriter.hh.
  154                   :
  156    {}
JRootReadableClass()
Default constructor.
 
 
 
 
◆ JBranchClass() [2/3]
  
  
      
        
          | JROOT::JBranchClass::JBranchClass  | 
          ( | 
          const JBranchClass & |           bc | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Copy constructor. 
- Parameters
 - 
  
  
 
Definition at line 164 of file JRootTypewriter.hh.
  164                                         :
  166    {
  167      this->
name = bc.name;
 
  168      this->
type = bc.type;
 
  169 
  170      if (this->
type != kOther_t) {
 
  171        this->
address = 
new char[TDataType::GetDataType(this->
type)->Size()];
 
  172      }
  173    }
 
 
 
◆ JBranchClass() [3/3]
  
  
      
        
          | JROOT::JBranchClass::JBranchClass  | 
          ( | 
          TBranch * |           pb | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
  
 
Definition at line 181 of file JRootTypewriter.hh.
  181                              :
  183    {
  184      if (pb != NULL) {
  185 
  186        this->
name = pb->GetName();
 
  187 
  188        TClass* cs;
  189 
  190        if (pb->GetExpectedType(cs, this->type) == 0) {
  191 
  192          if (cs != NULL)
  194          else
  195            this->
dictionary = TDictionary::GetDictionary(TDataType::GetTypeName(this->
type));
 
  196 
  197          if (this->
type != kOther_t) {
 
  198            this->
address = 
new char[TDataType::GetDataType(this->
type)->Size()];
 
  199          }
  200        }
  201      }
  202    }
TDictionary * dictionary
pointer to ROOT dictionary
 
 
 
 
◆ ~JBranchClass()
  
  
      
        
          | JROOT::JBranchClass::~JBranchClass  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ getName()
  
  
      
        
          | const char *const JROOT::JBranchClass::getName  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
 
◆ getType()
  
  
      
        
          | EDataType JROOT::JBranchClass::getType  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
 
◆ getAddress() [1/2]
  
  
      
        
          | void * JROOT::JBranchClass::getAddress  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
 
◆ operator const T &()
template<class T > 
  
  
      
        
          | JROOT::JRootReadableClass::operator const T &  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Type conversion operator. 
- Returns
 - value 
 
Definition at line 578 of file JRootClass.hh.
  579    {
  582      } else {
  583        THROW(JCastException, 
"JRootReadableClass::operator const T&");
 
  584      }
  585    }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
 
pointer_type getAddress() const
 
JRootClass()
Default constructor.
 
 
 
 
◆ operator T&()
template<class T > 
  
  
      
        
          | JROOT::JRootReadableClass::operator T&  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlineinherited   | 
  
 
Type conversion operator. 
- Returns
 - value 
 
Definition at line 594 of file JRootClass.hh.
  595    {
  598      } else {
  599        THROW(JCastException, 
"JRootReadableClass::operator T&");
 
  600      }
  601    }
 
 
 
◆ getAddress() [2/2]
Get address. 
- Returns
 - pointer to object 
 
Definition at line 408 of file JRootClass.hh.
  409    {
  411    }
int getOffset() const
Get offset of this class with respect to parent class.
 
 
 
 
◆ is_valid()
Check validity of this addressable class. 
- Returns
 - true if valid addressable class; else false 
 
Definition at line 419 of file JRootClass.hh.
  420    {
  422    }
bool is_valid() const
Check validity of this class.
 
 
 
 
◆ find() [1/2]
Find addressable base class or data member with given name within current class. 
- Parameters
 - 
  
    | name | name of base class or data member  | 
  
   
- Returns
 - ROOT addressable class 
 
Definition at line 431 of file JRootClass.hh.
  432    {
  434    }
JRootClass find(const char *const name, const bool option=true) const
Find base class or data member with given name within current class.
 
 
 
 
◆ find() [2/2]
  
  
      
        
          | JRootClass JROOT::JRootClass::find  | 
          ( | 
          const char *const |           name,  | 
         
        
           | 
           | 
          const bool |           option = true ) const | 
         
       
   | 
  
inlineinherited   | 
  
 
Find base class or data member with given name within current class. 
- Parameters
 - 
  
    | name | name of base class or data member  | 
    | option | case insensitive  | 
  
   
- Returns
 - ROOT class 
 
Definition at line 160 of file JRootClass.hh.
  161    {
  162      if (name != NULL && strlen(name) != 0) {
  163 
  165          return *this;
  166        }
  167 
  169 
  170          
  171 
  172          for (TIter next(this->
getClass()->GetListOfDataMembers(kFALSE)); 
const TDataMember *p = (
const TDataMember*) next(); ) {
 
  173            if (( option  &&  strcmp    (p->GetName(), name) == 0) ||
  174                (!option  &&  strcasecmp(p->GetName(), name) == 0)) { 
  175              return this->
get(*p);
 
  176            }
  177          }
  178          
  179          
  180          
  181          for (TIter next(this->
getClass()->GetListOfBases()); 
const TBaseClass *p = (
const TBaseClass*) next(); ) {
 
  182            
  184              
  186 
  187              rcs = rcs.find(name, option);
  188              
  189              if (rcs.is_valid()) {
  190                return rcs;
  191              }
  192            }
  193          }
  194        }
  195      }
  196 
  198    }
const char * getTypename() const
Get type name.
 
TClass * getClass() const
Get class.
 
JRootClass get(const TDataMember &object) const
Get ROOT class of given data member.
 
static bool is_class(const char *const name)
Check name of class against internal ROOT class names.
 
static bool is_STLcontainer(const TBaseClass &object)
Check if base class is STL container.
 
 
 
 
◆ get() [1/2]
Get addressable class of given data member. 
- Parameters
 - 
  
  
 
- Returns
 - ROOT addressable class 
 
Definition at line 443 of file JRootClass.hh.
  444    {
  446 
  447      if (object.IsaPointer()) {
  448 
  449        char* po = NULL;
  450 
  451        memcpy(&po, this->
getAddress() + 
object.GetOffset(), 
sizeof(
char*));
 
  452 
  454 
  455      } else if (strstr(object.GetTypeName(), "unique_ptr") != NULL) {
  456 
  457        char* po = NULL;
  458 
  459        memcpy(&po, this->
getAddress() + 
object.GetOffset(), 
sizeof(
char*));
 
  460 
  461        string buffer(object.GetTypeName());
  462 
  463        const string::size_type il = buffer.find_first_of("<");
  464        const string::size_type ir = buffer.find_first_of(">,");
  465 
  466        buffer = buffer.substr(il + 1, ir - il - 1);
  467 
  469 
  470      } else {
  471 
  473      }
  474    }
 
 
 
◆ get() [2/2]
Get addressable class of given base class. 
- Parameters
 - 
  
  
 
- Returns
 - ROOT addressable class 
 
Definition at line 483 of file JRootClass.hh.
 
 
◆ operator[]()
Find addressable base class or data member with given name within current class. 
- Parameters
 - 
  
    | name | name of base class or data member  | 
  
   
- Returns
 - ROOT addressable class 
 
Definition at line 495 of file JRootClass.hh.
  496    {
  497      return this->
find(name);
 
  498    }
JRootAddressableClass find(const char *const name) const
 
 
 
 
◆ getDictionary()
  
  
      
        
          | TDictionary * JROOT::JRootClass::getDictionary  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Get dictionary. 
- Returns
 - pointer to dictionary 
 
Definition at line 86 of file JRootClass.hh.
 
 
◆ getOffset()
  
  
      
        
          | int JROOT::JRootClass::getOffset  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Get offset of this class with respect to parent class. 
- Returns
 - offset 
 
Definition at line 97 of file JRootClass.hh.
   98    {
  100    }
int offset
offset with respect to data structure [B]
 
 
 
 
◆ getClass()
  
  
      
        
          | TClass * JROOT::JRootClass::getClass  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Get class. 
- Returns
 - pointer to class 
 
Definition at line 108 of file JRootClass.hh.
 
 
◆ getTypename()
  
  
      
        
          | const char * JROOT::JRootClass::getTypename  | 
          ( | 
           | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Get type name. 
- Returns
 - type name 
 
Definition at line 119 of file JRootClass.hh.
  120    {
  123      else
  124        return NULL;
  125    }
 
 
 
◆ equals()
  
  
      
        
          | bool JROOT::JRootClass::equals  | 
          ( | 
          const JRootClass & |           object | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Test equality of ROOT classes. 
- Parameters
 - 
  
  
 
- Returns
 - true if both ROOT classes are same type; else false 
 
Definition at line 145 of file JRootClass.hh.
 
 
◆ print() [1/3]
  
  
      
        
          | void JROOT::JRootClass::print  | 
          ( | 
          std::ostream & |           out | ) | 
           const | 
         
       
   | 
  
inlineinherited   | 
  
 
Print ROOT class information. 
- Parameters
 - 
  
  
 
Definition at line 232 of file JRootClass.hh.
  233    {
  235    }
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 | 
         
       
   | 
  
inlineprotectedinherited   | 
  
 
Print ROOT class information. 
- Parameters
 - 
  
    | out | output stream  | 
    | prefix | prefix  | 
  
   
Definition at line 259 of file JRootClass.hh.
  260    {
  262 
  264 
  266 
  267          for (TIter next(this->
getClass()->GetListOfBases()); 
const TBaseClass *p = (
const TBaseClass*) next(); ) {
 
  269              this->
get(*p).
print(out, prefix + 
"::" + p->GetName());
 
  270            else
  271              print(out, prefix + 
"::" + p->GetName(), this->get(*p).getTypename());
 
  272          }
  273          
  274          for (TIter next(this->
getClass()->GetListOfDataMembers(kFALSE)); 
const TDataMember *p = (
const TDataMember*) next(); ) {
 
  277            else
  278              print(out, prefix + (
JRoot::is_static(*p) ?  
"::" : 
".") + p->GetName(), this->get(*p).getTypename());
 
  279          }
  280        }
  281      }
  282    }
static bool is_static(const TDataMember &object)
Check if data member is static.
 
static bool is_STLstring(const TDataMember &object)
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 ) | 
         
       
   | 
  
inlinestaticprotectedinherited   | 
  
 
Print ROOT class information. 
- Parameters
 - 
  
    | out | output stream  | 
    | name | name  | 
    | type | type  | 
  
   
Definition at line 292 of file JRootClass.hh.
  293    {
  295 
  296      out << name << "  " << '(' << type << ')' << endl;
  297    }
 
 
 
◆ name
  
  
      
        
          | std::string JROOT::JBranchClass::name | 
         
       
   | 
  
private   | 
  
 
 
◆ type
  
  
      
        
          | EDataType JROOT::JBranchClass::type = kNoType_t | 
         
       
   | 
  
private   | 
  
 
 
◆ address
◆ dictionary
  
  
      
        
          | TDictionary* JROOT::JRootClass::dictionary | 
         
       
   | 
  
protectedinherited   | 
  
 
 
◆ offset
  
  
      
        
          | int JROOT::JRootClass::offset | 
         
       
   | 
  
protectedinherited   | 
  
 
offset with respect to data structure [B] 
Definition at line 241 of file JRootClass.hh.
 
 
The documentation for this struct was generated from the following file: