59 #define INSTANTIATE_READVAL(CLASS) \ 60 template Double_t CLASS::ReadValueImpl<Double_t>(char*, Int_t); \ 61 template Long64_t CLASS::ReadValueImpl<Long64_t>(char*, Int_t); \ 62 template LongDouble_t CLASS::ReadValueImpl<LongDouble_t>(char*, Int_t) // no semicolon 65 #define INSTANTIATE_GETVAL(CLASS) \ 66 template Double_t CLASS::GetValueImpl<Double_t>(TLeaf*, Int_t); \ 67 template Long64_t CLASS::GetValueImpl<Long64_t>(TLeaf*, Int_t); \ 68 template LongDouble_t CLASS::GetValueImpl<LongDouble_t>(TLeaf*, Int_t) // no semicolon 75 fClass(classptr),fOffset(offset),fElement(element),
76 fCounter(0), fNext(0),fMultiplicity(0)
200 offset = info->TStreamerInfo::GetElementOffset(
id);
218 type = info->TStreamerInfo::GetElement(
id)->
GetNewType();
226 Error(
"GetValuePointer",
"Type (%d) not yet supported\n", type);
238 index = instance / len;
239 sub_instance = instance % len;
244 thisobj = address + offset + (index *
fClass->
Size());
245 instance = sub_instance;
257 thisobj = address + offset;
294 thisobj = address + offset;
299 thisobj = *((
char**) (address + offset));
526 char * work =
new char[nchname+2];
527 for (i=0, current = &(work[0]),
fOffset=0; i<nchname+1;i++ ) {
558 current = &(work[0]);
606 thisobj = (
char*)((
TLeafObject*)leaf)->GetObject();
610 if (!thisobj)
return 0;
642 if (
fElement==0 || thisobj==0)
return thisobj;
697 #define GET_ARRAY(TYPE_t) \ 699 Int_t len, sub_instance, index; \ 700 if (fNext) len = fNext->GetArrayLength(); \ 703 index = instance / len; \ 704 sub_instance = instance % len; \ 709 TYPE_t **val = (TYPE_t**)(thisobj+fOffset); \ 710 return &((val[sub_instance])[index]); \ 731 {
char **stringp = (
char**)(thisobj+
fOffset);
return *stringp;}
760 index = instance / len;
789 template <
typename T>
790 T TFormLeafInfo::GetValueImpl(
TLeaf *leaf,
Int_t instance)
794 thisobj = (
char*)((
TLeafObject*)leaf)->GetObject();
798 if (thisobj==0)
return 0;
799 return ReadTypedValue<T>(thisobj,instance);
808 template <
typename T>
809 T TFormLeafInfo::ReadValueImpl(
char *thisobj,
Int_t instance)
812 Error(
"ReadValue",
"Invalid data address: result will be wrong");
816 char *nextobj = thisobj+
fOffset;
817 Int_t sub_instance = instance;
825 index = instance / len;
826 sub_instance = instance % len;
885 #if defined(_MSC_VER) && (_MSC_VER <= 1200) 893 #define READ_ARRAY(TYPE_t) \ 895 Int_t len, sub_instance, index; \ 896 len = GetArrayLength(); \ 898 index = instance / len; \ 899 sub_instance = instance % len; \ 904 TYPE_t **val =(TYPE_t**)(thisobj+fOffset); \ 905 return T((val[sub_instance])[index]); \ 923 #if defined(_MSC_VER) && (_MSC_VER <= 1200) 944 from->GetInfo()->GetElement(from->GetID()))
961 Error(
"ReadValue",
"Should not be used in a TFormLeafInfoDirect");
968 template <
typename T>
969 T TFormLeafInfoDirect::GetValueImpl(
TLeaf *leaf,
Int_t instance)
1005 fKind(kind), fIsBool(
kFALSE)
1104 return &gFakeClonesElem;
1199 template <
typename T>
1200 T TFormLeafInfoClones::ReadValueImpl(
char *where,
Int_t instance)
1202 if (
fNext==0)
return 0;
1203 Int_t len,index,sub_instance;
1206 index = instance / len;
1207 sub_instance = instance % len;
1213 if (!clones)
return 0;
1253 template <
typename T>
1254 T TFormLeafInfoClones::GetValueImpl(
TLeaf *leaf,
Int_t instance)
1256 if (
fNext==0)
return 0;
1257 Int_t len,index,sub_instance;
1261 index = instance / len;
1262 sub_instance = instance % len;
1263 }
else if (primary>=0) {
1265 sub_instance = instance;
1271 if (clones==0)
return 0;
1285 if (
fNext && clones) {
1287 Int_t len,index,sub_instance;
1290 index = instance / len;
1291 sub_instance = instance % len;
1310 Int_t len,index,sub_instance;
1313 index = instance / len;
1314 sub_instance = instance % len;
1413 template <
typename T>
1414 T TFormLeafInfoCollectionObject::GetValueImpl(
TLeaf *leaf,
Int_t instance)
1418 if (
fNext==0)
return 0;
1467 }
else if (classptr) {
1501 if (elementclassptr) {
1503 }
else if (motherclassptr) {
1618 if (ptr==0)
return 0;
1630 if (where==0)
return 0;
1646 if (ptr==0)
return 0;
1655 template <
typename T>
1656 T TFormLeafInfoCollection::ReadValueImpl(
char *where,
Int_t instance)
1658 if (
fNext==0)
return 0;
1659 UInt_t len,index,sub_instance;
1663 index = instance / len;
1664 sub_instance = instance % len;
1665 }
else if (primary>=0) {
1667 sub_instance = instance;
1718 template <
typename T>
1719 T TFormLeafInfoCollection::GetValueImpl(
TLeaf *leaf,
Int_t instance)
1721 if (
fNext==0)
return 0;
1722 Int_t len,index,sub_instance;
1726 index = instance / len;
1727 sub_instance = instance % len;
1728 }
else if (primary>=0) {
1730 sub_instance = instance;
1743 if (obj==0)
return 0;
1745 if (obj==0)
return 0;
1760 Int_t len,index,sub_instance;
1768 index = instance / len;
1769 sub_instance = instance % len;
1789 void *collection = where;
1793 Int_t len,index,sub_instance;
1796 index = instance / len;
1797 sub_instance = instance % len;
1926 Error(
"GetValuePointer",
"This should never be called");
1935 Error(
"GetValuePointer",
"This should never be called");
1944 Error(
"GetLocalValuePointer",
"This should never be called");
1953 Error(
"GetLocalValuePointer",
"This should never be called");
1963 if (where==0)
return 0;
1995 template <
typename T>
1996 T TFormLeafInfoPointer::ReadValueImpl(
char *where,
Int_t instance)
1998 if (!
fNext)
return 0;
1999 char * whereoffset = where+
fOffset;
2026 Int_t len, index, sub_instance;
2031 index = instance / len;
2032 sub_instance = instance % len;
2063 template <
typename T>
2064 T TFormLeafInfoPointer::GetValueImpl(
TLeaf *leaf,
Int_t instance)
2066 if (!
fNext)
return 0;
2068 if (where==0)
return 0;
2086 fResult(0), fCopyFormat(),fDeleteFormat(),fValuePointer(0),fIsByValue(
kFALSE)
2095 if (rtype[strlen(rtype)-1]!=
'*' &&
2096 rtype[strlen(rtype)-1]!=
'&' &&
2243 void *thisobj = from;
2244 if (!thisobj)
return 0;
2266 char *returntext = 0;
2272 char * char_result = 0;
2294 template <
typename T>
2295 T TFormLeafInfoMethod::ReadValueImpl(
char *where,
Int_t instance)
2297 void *thisobj = where;
2298 if (!thisobj)
return 0;
2314 char *returntext = 0;
2316 result =
T((
Long_t) returntext);
2319 char * char_result = 0;
2346 TFormLeafInfo(classptr,offset,element),fNsize(0),fCounter2(0),fSumOfSizes(0),
2347 fDim(0),fVirtDim(-1),fPrimaryIndex(-1),fSecondaryIndex(-1)
2352 Int_t counterOffset = 0;
2354 if (!parent)
return;
2357 while(*next != 0) next = &( (*next)->fNext);
2360 }
else Error(
"Constructor",
"Called without a proper TStreamerElement");
2523 Error(
"GetValue",
"This should never be called");
2568 if (global==0 || local<global) global = local;
2569 garr->
AddAt(global,i);
2590 template <
typename T>
2591 T TFormLeafInfoMultiVarDimDirect::GetValueImpl(
TLeaf *leaf,
Int_t instance)
2603 Error(
"ReadValue",
"This should never be called");
2637 while(*next != 0) next = &( (*next)->fNext);
2655 while(*next != 0) next = &( (*next)->fNext);
2673 Error(
"GetValue",
"This should never be called");
2700 template <
typename T>
2701 T TFormLeafInfoMultiVarDimCollection::ReadValueImpl(
char *where,
Int_t instance)
2747 while(*next != 0) next = &( (*next)->fNext);
2765 while(*next != 0) next = &( (*next)->fNext);
2783 Error(
"GetValue",
"This should never be called");
2813 template <
typename T>
2814 T TFormLeafInfoMultiVarDimClones::ReadValueImpl(
char *where,
Int_t instance)
2907 template <
typename T>
2908 T TFormLeafInfoCast::ReadValueImpl(
char *where,
Int_t instance)
2910 if (!
fNext)
return 0;
2986 template <
typename T>
2987 T TFormLeafInfoTTree::GetValueImpl(
TLeaf *,
Int_t instance)
2989 return ReadTypedValue<T>((
char*)
fCurrent,instance);
2995 template <
typename T>
2996 T TFormLeafInfoTTree::ReadValueImpl(
char *thisobj,
Int_t instance)
2998 if (
fElement)
return TFormLeafInfo::ReadTypedValue<T>(thisobj,instance);
Describe Streamer information for one class version.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
Equal to TDataType's kchar.
static const EReturnType kOther
void swap(TDirectoryEntry &e1, TDirectoryEntry &e2) noexcept
TBranchElement * GetBranchCount2() const
A TLeaf for a general object derived from TObject.
char * GetObject() const
Return a pointer to our object.
const char * GetParams() const
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
virtual EDataType GetType() const =0
static const EReturnType kLong
virtual TTree * GetFriend(const char *) const
Return a pointer to the TTree friend whose name or alias is 'friendname.
TBranch * GetBranch() const
const char * GetMethodName() const
Array of integers (32 bits per element).
virtual TClass * GetCollectionClass() const
static const EReturnType kString
TBranchElement * GetBranchCount() const
const char * Data() const
virtual Bool_t HasPointers() const =0
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
void Init(const TFunction *func)
Initialize the method invocation environment based on the TFunction object.
virtual TVirtualCollectionProxy * Generate() const =0
TString & Append(const char *cs)
static const EReturnType kDouble
Method or function calling interface.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
void Set(Int_t n)
Set size of this array to n ints.
void AddAt(Int_t c, Int_t i)
Add Int_t c at position i. Check for out of bounds.
TObject * UncheckedAt(Int_t i) const
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
T GetTypedValue(Int_t i=0) const
void Copy(TArrayI &array) const
char * Form(const char *fmt,...)
virtual const char * GetName() const
Returns name of object.
The ROOT global object gROOT contains a list of all defined classes.
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
A TLeaf for the general case when using the branches created via a TStreamerInfo (i.e.
A Branch for the case of an object.
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
const char * GetCountName() const
TFunction * GetMethod()
Returns the TMethod describing the method to be executed.
virtual const char * GetName() const
Returns name of object.
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
Int_t GetNewType(Int_t id) const
unsigned long long ULong64_t
virtual void * At(UInt_t idx)=0
TObjArray * GetListOfLeaves()
Int_t GetEntries() const
Return the number of objects in array (i.e.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
TClass * GetClass() const
Mother of all ROOT objects.
An array of clone (identical) objects.
virtual char * GetAddress() const
Get the branch address.
virtual void * GetValuePointer() const
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
A TTree object has a header with a name and a title.
Int_t GetMakeClass() const
TObject * At(Int_t idx) const
A TTree is a list of TBranches.
Int_t Size() const
Return size of object of this class.
EReturnType ReturnType()
Returns the return type of the method.
virtual UInt_t Size() const =0
Int_t GetArrayLength() const