60 #define INSTANTIATE_READVAL(CLASS) \ 61 template Double_t CLASS::ReadValueImpl<Double_t>(char*, Int_t); \ 62 template Long64_t CLASS::ReadValueImpl<Long64_t>(char*, Int_t); \ 63 template LongDouble_t CLASS::ReadValueImpl<LongDouble_t>(char*, Int_t) // no semicolon 66 #define INSTANTIATE_GETVAL(CLASS) \ 67 template Double_t CLASS::GetValueImpl<Double_t>(TLeaf*, Int_t); \ 68 template Long64_t CLASS::GetValueImpl<Long64_t>(TLeaf*, Int_t); \ 69 template LongDouble_t CLASS::GetValueImpl<LongDouble_t>(TLeaf*, Int_t) // no semicolon 76 fClass(classptr),fOffset(offset),fElement(element),
77 fCounter(0), fNext(0),fMultiplicity(0)
201 offset = info->TStreamerInfo::GetElementOffset(
id);
219 type = info->TStreamerInfo::GetElement(
id)->
GetNewType();
227 Error(
"GetValuePointer",
"Type (%d) not yet supported\n", type);
239 index = instance / len;
240 sub_instance = instance % len;
245 thisobj = address + offset + (index *
fClass->
Size());
246 instance = sub_instance;
258 thisobj = address + offset;
295 thisobj = address + offset;
300 thisobj = *((
char**) (address + offset));
527 char * work =
new char[nchname+2];
528 for (i=0, current = &(work[0]),
fOffset=0; i<nchname+1;i++ ) {
559 current = &(work[0]);
607 thisobj = (
char*)((
TLeafObject*)leaf)->GetObject();
611 if (!thisobj)
return 0;
643 if (
fElement==0 || thisobj==0)
return thisobj;
698 #define GET_ARRAY(TYPE_t) \ 700 Int_t len, sub_instance, index; \ 701 if (fNext) len = fNext->GetArrayLength(); \ 704 index = instance / len; \ 705 sub_instance = instance % len; \ 710 TYPE_t **val = (TYPE_t**)(thisobj+fOffset); \ 711 return &((val[sub_instance])[index]); \ 732 {
char **stringp = (
char**)(thisobj+
fOffset);
return *stringp;}
761 index = instance / len;
790 template <
typename T>
791 T TFormLeafInfo::GetValueImpl(
TLeaf *leaf,
Int_t instance)
795 thisobj = (
char*)((
TLeafObject*)leaf)->GetObject();
799 if (thisobj==0)
return 0;
800 return ReadTypedValue<T>(thisobj,instance);
809 template <
typename T>
810 T TFormLeafInfo::ReadValueImpl(
char *thisobj,
Int_t instance)
813 Error(
"ReadValue",
"Invalid data address: result will be wrong");
817 char *nextobj = thisobj+
fOffset;
818 Int_t sub_instance = instance;
826 index = instance / len;
827 sub_instance = instance % len;
886 #if defined(_MSC_VER) && (_MSC_VER <= 1200) 894 #define READ_ARRAY(TYPE_t) \ 896 Int_t len, sub_instance, index; \ 897 len = GetArrayLength(); \ 899 index = instance / len; \ 900 sub_instance = instance % len; \ 905 TYPE_t **val =(TYPE_t**)(thisobj+fOffset); \ 906 return T((val[sub_instance])[index]); \ 924 #if defined(_MSC_VER) && (_MSC_VER <= 1200) 945 from->GetInfo()->GetElement(from->GetID()))
962 Error(
"ReadValue",
"Should not be used in a TFormLeafInfoDirect");
969 template <
typename T>
970 T TFormLeafInfoDirect::GetValueImpl(
TLeaf *leaf,
Int_t instance)
1006 fKind(kind), fIsBool(
kFALSE)
1105 return &gFakeClonesElem;
1200 template <
typename T>
1201 T TFormLeafInfoClones::ReadValueImpl(
char *where,
Int_t instance)
1203 if (
fNext==0)
return 0;
1204 Int_t len,index,sub_instance;
1207 index = instance / len;
1208 sub_instance = instance % len;
1214 if (!clones)
return 0;
1254 template <
typename T>
1255 T TFormLeafInfoClones::GetValueImpl(
TLeaf *leaf,
Int_t instance)
1257 if (
fNext==0)
return 0;
1258 Int_t len,index,sub_instance;
1262 index = instance / len;
1263 sub_instance = instance % len;
1264 }
else if (primary>=0) {
1266 sub_instance = instance;
1272 if (clones==0)
return 0;
1286 if (
fNext && clones) {
1288 Int_t len,index,sub_instance;
1291 index = instance / len;
1292 sub_instance = instance % len;
1311 Int_t len,index,sub_instance;
1314 index = instance / len;
1315 sub_instance = instance % len;
1414 template <
typename T>
1415 T TFormLeafInfoCollectionObject::GetValueImpl(
TLeaf *leaf,
Int_t instance)
1419 if (
fNext==0)
return 0;
1468 }
else if (classptr) {
1502 if (elementclassptr) {
1504 }
else if (motherclassptr) {
1619 if (ptr==0)
return 0;
1631 if (where==0)
return 0;
1647 if (ptr==0)
return 0;
1656 template <
typename T>
1657 T TFormLeafInfoCollection::ReadValueImpl(
char *where,
Int_t instance)
1659 if (
fNext==0)
return 0;
1660 UInt_t len,index,sub_instance;
1664 index = instance / len;
1665 sub_instance = instance % len;
1666 }
else if (primary>=0) {
1668 sub_instance = instance;
1719 template <
typename T>
1720 T TFormLeafInfoCollection::GetValueImpl(
TLeaf *leaf,
Int_t instance)
1722 if (
fNext==0)
return 0;
1723 Int_t len,index,sub_instance;
1727 index = instance / len;
1728 sub_instance = instance % len;
1729 }
else if (primary>=0) {
1731 sub_instance = instance;
1744 if (obj==0)
return 0;
1746 if (obj==0)
return 0;
1761 Int_t len,index,sub_instance;
1769 index = instance / len;
1770 sub_instance = instance % len;
1790 void *collection = where;
1794 Int_t len,index,sub_instance;
1797 index = instance / len;
1798 sub_instance = instance % len;
1927 Error(
"GetValuePointer",
"This should never be called");
1936 Error(
"GetValuePointer",
"This should never be called");
1945 Error(
"GetLocalValuePointer",
"This should never be called");
1954 Error(
"GetLocalValuePointer",
"This should never be called");
1964 if (where==0)
return 0;
1996 template <
typename T>
1997 T TFormLeafInfoPointer::ReadValueImpl(
char *where,
Int_t instance)
1999 if (!
fNext)
return 0;
2000 char * whereoffset = where+
fOffset;
2027 Int_t len, index, sub_instance;
2032 index = instance / len;
2033 sub_instance = instance % len;
2064 template <
typename T>
2065 T TFormLeafInfoPointer::GetValueImpl(
TLeaf *leaf,
Int_t instance)
2067 if (!
fNext)
return 0;
2069 if (where==0)
return 0;
2087 fResult(0), fCopyFormat(),fDeleteFormat(),fValuePointer(0),fIsByValue(
kFALSE)
2096 if (rtype[strlen(rtype)-1]!=
'*' &&
2097 rtype[strlen(rtype)-1]!=
'&' &&
2192 std::string return_type;
2208 return_type =
gInterpreter->TypeName(return_type.c_str());
2210 if (return_type ==
"void")
2279 void *thisobj = from;
2280 if (!thisobj)
return 0;
2302 char *returntext = 0;
2308 char * char_result = 0;
2330 template <
typename T>
2331 T TFormLeafInfoMethod::ReadValueImpl(
char *where,
Int_t instance)
2333 void *thisobj = where;
2334 if (!thisobj)
return 0;
2350 char *returntext = 0;
2352 result =
T((
Long_t) returntext);
2355 char * char_result = 0;
2382 TFormLeafInfo(classptr,offset,element),fNsize(0),fCounter2(0),fSumOfSizes(0),
2383 fDim(0),fVirtDim(-1),fPrimaryIndex(-1),fSecondaryIndex(-1)
2388 Int_t counterOffset = 0;
2390 if (!parent)
return;
2393 while(*next != 0) next = &( (*next)->fNext);
2396 }
else Error(
"Constructor",
"Called without a proper TStreamerElement");
2559 Error(
"GetValue",
"This should never be called");
2604 if (global==0 || local<global) global = local;
2605 garr->
AddAt(global,i);
2626 template <
typename T>
2627 T TFormLeafInfoMultiVarDimDirect::GetValueImpl(
TLeaf *leaf,
Int_t instance)
2639 Error(
"ReadValue",
"This should never be called");
2673 while(*next != 0) next = &( (*next)->fNext);
2691 while(*next != 0) next = &( (*next)->fNext);
2709 Error(
"GetValue",
"This should never be called");
2736 template <
typename T>
2737 T TFormLeafInfoMultiVarDimCollection::ReadValueImpl(
char *where,
Int_t instance)
2783 while(*next != 0) next = &( (*next)->fNext);
2801 while(*next != 0) next = &( (*next)->fNext);
2819 Error(
"GetValue",
"This should never be called");
2849 template <
typename T>
2850 T TFormLeafInfoMultiVarDimClones::ReadValueImpl(
char *where,
Int_t instance)
2943 template <
typename T>
2944 T TFormLeafInfoCast::ReadValueImpl(
char *where,
Int_t instance)
2946 if (!
fNext)
return 0;
3022 template <
typename T>
3023 T TFormLeafInfoTTree::GetValueImpl(
TLeaf *,
Int_t instance)
3025 return ReadTypedValue<T>((
char*)
fCurrent,instance);
3031 template <
typename T>
3032 T TFormLeafInfoTTree::ReadValueImpl(
char *thisobj,
Int_t instance)
3034 if (
fElement)
return TFormLeafInfo::ReadTypedValue<T>(thisobj,instance);
Describe Streamer information for one class version.
virtual const char * GetName() const
Returns name of object.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
TBranchElement * GetBranchCount2() const
void Copy(TArrayI &array) const
Equal to TDataType's kchar.
static const EReturnType kOther
const char * GetReturnTypeName() const
Get full type description of function return type, e,g.: "class TDirectory*".
virtual TTree * GetFriend(const char *) const
Return a pointer to the TTree friend whose name or alias is 'friendname.
void swap(TDirectoryEntry &e1, TDirectoryEntry &e2) noexcept
A TLeaf for a general object derived from TObject.
Int_t GetMakeClass() const
virtual TClass * GetClassPointer() const
Returns a pointer to the TClass of this element.
TVirtualStreamerInfo * GetStreamerInfo(Int_t version=0) const
returns a pointer to the TVirtualStreamerInfo object for version If the object does not exist...
virtual TClass * GetCollectionClass() const
TStreamerInfo * GetInfo() const
Get streamer info for the branch class.
static const EReturnType kLong
TVirtualCollectionProxy * GetCollectionProxy() const
Return the proxy describing the collection (if any).
Int_t GetArrayLength() const
TObject * At(Int_t idx) const
virtual EDataType GetType() const =0
Array of integers (32 bits per element).
TBranchElement * GetBranchCount() const
static const EReturnType kString
void Init(const TFunction *func)
Initialize the method invocation environment based on the TFunction object.
Bool_t IsLoaded() const
Return true if the shared library of this class is currently in the a process's memory.
#define R__WRITE_LOCKGUARD(mutex)
TString & Append(const char *cs)
Long_t Property() const
Get property description word. For meaning of bits see EProperty.
static const EReturnType kDouble
R__EXTERN TVirtualRWMutex * gCoreMutex
Method or function calling interface.
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.
const char * GetMethodName() const
virtual char * GetAddress() const
Get the branch address.
void GetNormalizedName(std::string &norm_name, std::string_view name)
Return the normalized name.
char * GetObject() const
Return a pointer to our object.
virtual Bool_t HasPointers() const =0
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
char * Form(const char *fmt,...)
Int_t Size() const
Return size of object of this class.
virtual void * GetValuePointer() const
The ROOT global object gROOT contains a list of all defined classes.
const char * GetParams() const
A TLeaf for the general case when using the branches created via a TStreamerInfo (i.e.
A Branch for the case of an object.
TFunction * GetMethod()
Returns the TMethod describing the method to be executed.
TObject * UncheckedAt(Int_t i) const
unsigned long long ULong64_t
virtual void * At(UInt_t idx)=0
TObjArray * GetListOfLeaves()
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.
Mother of all ROOT objects.
virtual UInt_t Size() const =0
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
An array of clone (identical) objects.
Int_t GetNewType(Int_t id) const
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
const char * GetCountName() const
Int_t GetEntries() const
Return the number of objects in array (i.e.
A TTree object has a header with a name and a title.
R__EXTERN TInterpreter * gCling
TBranch * GetBranch() const
virtual const char * GetName() const
Returns name of object.
A TTree is a list of TBranches.
T GetTypedValue(Int_t i=0) const
EReturnType ReturnType()
Returns the return type of the method.
TClass * GetClass() const
virtual TVirtualCollectionProxy * Generate() const =0
virtual int SetClassAutoloading(int) const
const char * Data() const