Jpp 19.3.0-rc.1
the software that should make you happy
Loading...
Searching...
No Matches
JROOT::JRoot Struct Reference

#include <JRoot.hh>

Static Public Member Functions

static bool is_class (const char *const name)
 Check name of class against internal ROOT class names.
 
static bool is_class (const TBaseClass &object)
 Check base class against internal ROOT class names.
 
static bool is_class (const TDataMember &object)
 Check data member against internal ROOT class names.
 
static bool is_STLcontainer (const TBaseClass &object)
 Check if base class is STL container.
 
static bool is_STLcontainer (const TDataMember &object)
 Check if data member is STL container.
 
static bool is_STLstring (const TDataMember &object)
 Check if data member is STL string.
 
static bool is_static (const TDataMember &object)
 Check if data member is static.
 
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).
 
template<class T >
static const char * getTypename ()
 Get ROOT typename for given template class.
 

Detailed Description

Definition at line 23 of file JRoot.hh.

Member Function Documentation

◆ is_class() [1/3]

static bool JROOT::JRoot::is_class ( const char *const name)
inlinestatic

Check name of class against internal ROOT class names.

Parameters
namename of class
Returns
true if name of class corresponds to genuine class; else false

Definition at line 30 of file JRoot.hh.

31 {
32 return (name != NULL &&
33 strcmp(name, TClass ::Class()->GetName()) != 0 &&
34 strcmp(name, TObject::Class()->GetName()) != 0 &&
35 strcmp(name, "This") != 0 &&
36 strcmp(name, "_Rb_tree_node_base") != 0 &&
37 strcmp(name, "fgIsA") != 0 &&
38 strcmp(name, "atomic<TClass*>") != 0);
39 }

◆ is_class() [2/3]

static bool JROOT::JRoot::is_class ( const TBaseClass & object)
inlinestatic

Check base class against internal ROOT class names.

Parameters
objectbase class
Returns
true if valid class; else false

Definition at line 48 of file JRoot.hh.

49 {
50 return is_class(object.GetName());
51 }
static bool is_class(const char *const name)
Check name of class against internal ROOT class names.
Definition JRoot.hh:30

◆ is_class() [3/3]

static bool JROOT::JRoot::is_class ( const TDataMember & object)
inlinestatic

Check data member against internal ROOT class names.

Parameters
objectdata member
Returns
true if valid class; else false

Definition at line 60 of file JRoot.hh.

61 {
62 return is_class(object.GetTypeName());
63 }

◆ is_STLcontainer() [1/2]

static bool JROOT::JRoot::is_STLcontainer ( const TBaseClass & object)
inlinestatic

Check if base class is STL container.

Parameters
objectbase class
Returns
true if STL container; else false

Definition at line 72 of file JRoot.hh.

73 {
74 return (const_cast<TBaseClass&>(object).IsSTLContainer() != ROOT::kNotSTL);
75 }

◆ is_STLcontainer() [2/2]

static bool JROOT::JRoot::is_STLcontainer ( const TDataMember & object)
inlinestatic

Check if data member is STL container.

Parameters
objectdata member
Returns
true if STL container; else false

Definition at line 84 of file JRoot.hh.

85 {
86 return (const_cast<TDataMember&>(object).IsSTLContainer() != ROOT::kNotSTL);
87 }

◆ is_STLstring()

static bool JROOT::JRoot::is_STLstring ( const TDataMember & object)
inlinestatic

Check if data member is STL string.

Parameters
objectdata member
Returns
true if STL string; else false

Definition at line 96 of file JRoot.hh.

97 {
98 return (strcmp(object.GetFullTypeName(), "string") == 0 ||
99 strcmp(object.GetFullTypeName(), "const string") == 0);
100 }

◆ is_static()

static bool JROOT::JRoot::is_static ( const TDataMember & object)
inlinestatic

Check if data member is static.

Parameters
objectdata member
Returns
true if static; else false

Definition at line 109 of file JRoot.hh.

110 {
111 return (object.Property() & kIsStatic);
112 }

◆ is_tobject_member()

static bool JROOT::JRoot::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).

Parameters
namename
Returns
true if TObect data member; else false

Definition at line 122 of file JRoot.hh.

123 {
124 static TClass* o_class = TClass::GetClass<TObject>();
125
126 return o_class->GetListOfRealData()->FindObject(name) != nullptr;
127 }

◆ getTypename()

template<class T >
static const char * JROOT::JRoot::getTypename ( )
inlinestatic

Get ROOT typename for given template class.

This method uses the TDictionary class to get the name of the given class.

Returns
type name

Definition at line 138 of file JRoot.hh.

139 {
140 static const TDictionary* pDictionary = TDictionary::GetDictionary(typeid(T));
141
142 if (pDictionary != NULL)
143 return pDictionary->GetName();
144 else
145 return NULL;
146 }

The documentation for this struct was generated from the following file: