12 #ifndef ROOT_TBranchProxy 13 #define ROOT_TBranchProxy 54 if (left[0]&&right && fName[fName.
Length()-1]!=
'.') fName +=
".";
60 operator const char*() {
return fName.
Data(); };
104 virtual void Print();
130 if (fDirector==0)
return false;
133 if (!IsInitialized()) {
135 ::Error(
"TBranchProxy::Read",
"%s",
Form(
"Unable to initialize %s\n",fBranchName.
Data()));
141 result = fParent->
Read();
144 result &= (-1 != fBranchCount->GetEntry(fDirector->
GetReadEntry()));
152 fCollection->
PushProxy( *(
void**)fWhere );
159 return IsInitialized();
164 if (fDirector==0)
return false;
167 if (!IsInitialized()) {
169 ::Error(
"TBranchProxy::ReadEntries",
"%s",
Form(
"Unable to initialize %s\n",fBranchName.
Data()));
176 fBranchCount->TBranch::GetEntry(fDirector->
GetReadEntry());
183 return IsInitialized();
187 if (!ReadEntries())
return 0;
188 if (!fHasLeafCount) {
189 return *(
Int_t*)fLeafCount->GetValuePointer();
200 if (fDirector==0)
return 0;
202 if (!IsInitialized()) {
227 fWhere = ((
unsigned char*)fParent->
GetStart()) + fMemberOffset;
230 if (fWhere)
return *(
void**)fWhere;
251 location = (
char*)tca->
At(i);
255 }
else if (fParent) {
269 location = (
char*)tca->
At(i);
272 if (location) location += fOffset;
276 return *(
void**)(location);
292 if (fCollection->
Size()<i)
return 0;
294 location = (
char*)fCollection->
At(i);
298 }
else if (fParent) {
316 if (location) location += fOffset;
320 return *(
void**)(location);
339 std::cout <<
"fWhere " << fWhere << std::endl;
340 if (fWhere) std::cout <<
"value? " << *(
unsigned char*)GetStart() << std::endl;
348 if (!Read())
return nullptr;
349 unsigned char* str = (
unsigned char*)GetStart();
354 static unsigned char default_val = {};
355 if (
unsigned char* elAddr = (
unsigned char*)GetAddressOfElement(i)) {
362 unsigned char operator [](
Int_t i) {
370 operator const char*() {
371 if (!Read())
return "";
372 return (
const char*)GetStart();
376 if (!Read())
return "";
377 return (
const char*)GetStart();
381 if (!Read())
return "";
382 return (
const char*)GetStart();
385 operator std::string() {
386 if (!Read())
return "";
387 return std::string((
const char*)GetStart());
398 std::cout <<
"fWhere " << fWhere << std::endl;
401 std::cout <<
"location " << *(
TClonesArray**)fWhere << std::endl;
403 std::cout <<
"location " << fWhere << std::endl;
413 if (!Read())
return 0;
418 if (!ReadEntries())
return 0;
425 if (!Read())
return nullptr;
426 if (fWhere==0)
return nullptr;
427 return GetClaStart(i);
440 std::cout <<
"fWhere " << fWhere << std::endl;
443 std::cout <<
"location " << *(
TClonesArray**)fWhere << std::endl;
445 std::cout <<
"location " << fWhere << std::endl;
455 if (!Read())
return 0;
456 return GetCollection();
460 if (!ReadEntries())
return 0;
461 return GetPtr()->Size();
465 if (!Read())
return nullptr;
466 if (fWhere==0)
return nullptr;
467 return GetStlStart(i);
481 std::cout <<
"fWhere " << fWhere << std::endl;
482 if (fWhere) std::cout <<
"value? " << *(
T*)GetStart() << std::endl;
490 if (!Read())
return 0;
491 return *(
T*)GetStart();
505 typedef T array_t[
d];
519 typedef typename T::array_t array_t[
d];
537 std::cout <<
"fWhere " << GetWhere() << std::endl;
538 if (GetWhere()) std::cout <<
"value? " << *(type_t*)GetWhere() << std::endl;
546 if (!Read())
return nullptr;
547 if (array_t *arr = (array_t*)((type_t*)(GetStart())))
553 static array_t default_val;
555 if (array_t *arr = (array_t*)GetAddressOfElement(i))
560 const array_t &operator [](
Int_t i) {
return At(i); }
561 const array_t &operator [](
UInt_t i) {
return At(i); }
579 static T default_val;
580 if (
void* addr = GetAddressOfElement(i))
585 const T& operator [](
Int_t i) {
return At(i); }
586 const T& operator [](
UInt_t i) {
return At(i); }
609 static T default_val;
610 if (
void* addr = GetAddressOfElement(i))
615 const T& operator [](
Int_t i) {
return At(i); }
616 const T& operator [](
UInt_t i) {
return At(i); }
641 static array_t default_val;
642 if (array_t* ptr = (array_t*)GetAddressOfElement(i))
648 array_t *operator [](
Int_t i) {
return At(i); }
649 array_t *operator [](
UInt_t i) {
return At(i); }
670 static array_t default_val;
671 if (array_t* ptr = (array_t*)GetAddressOfElement(i))
676 array_t *operator [](
Int_t i) {
return At(i); }
677 array_t *operator [](
UInt_t i) {
return At(i); }
TStlArrayProxy< TArrayType< Bool_t > > TStlArrayBoolProxy
TStlArrayProxy< TArrayType< Int_t > > TStlArrayIntProxy
TImpProxy< Double32_t > TDouble32Proxy
TStlArrayProxy< TArrayType< Double_t > > TStlArrayDoubleProxy
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Int_t GetEntries() override
TArrayProxy< TArrayType< Double_t > > TArrayDoubleProxy
TClaImpProxy< Float_t > TClaFloatProxy
TStlArrayProxy< TArrayType< UShort_t > > TStlArrayUShortProxy
void * GetClaStart(UInt_t i=0)
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
const TString fDataMember
TStlArrayProxy< TArrayType< Long64_t > > TStlArrayLong64Proxy
Namespace for new ROOT classes and functions.
TStlImpProxy< Float16_t > TStlFloat16Proxy
#define R__unlikely(expr)
TArrayProxy< TArrayType< Long64_t > > TArrayLong64Proxy
TStlImpProxy< ULong64_t > TStlULong64Proxy
TImpProxy< Double_t > TDoubleProxy
const TVirtualCollectionProxy * operator->()
TStlArrayProxy< TArrayType< UChar_t > > TStlArrayUCharProxy
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
TImpProxy< ULong64_t > TULong64Proxy
virtual void PushProxy(void *objectstart)=0
TStlArrayProxy< TArrayType< UShort_t > > TStlArrayShortProxy
R__EXTERN PyObject * gSize
TArrayProxy< TArrayType< Long_t > > TArrayLongProxy
TClaImpProxy< UInt_t > TClaUIntProxy
TClaArrayProxy< TArrayType< Char_t > > TClaArrayCharProxy
TImpProxy< Char_t > TCharProxy
TStlImpProxy< Long64_t > TStlLong64Proxy
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
const TClonesArray * operator->()
TArrayProxy< TArrayType< UShort_t > > TArrayUShortProxy
TStreamerElement * fElement
TArrayProxy< TArrayType< Double32_t > > TArrayDouble32Proxy
TClaImpProxy< Float16_t > TClaFloat16Proxy
virtual void * GetStart(UInt_t=0)
TImpProxy< Float_t > TFloatProxy
TClaImpProxy< Long_t > TClaLongProxy
TObject * At(Int_t idx) const
TClaImpProxy< UShort_t > TClaUShortProxy
TArrayProxy< TArrayType< ULong_t > > TArrayULongProxy
TClaArrayProxy< TArrayType< UInt_t > > TClaArrayUIntProxy
TStlArrayProxy< TArrayType< ULong_t > > TStlArrayULongProxy
Int_t GetEntries() override
TStlArrayProxy< TArrayType< Float16_t > > TStlArrayFloat16Proxy
TStlImpProxy< Short_t > TStlShortProxy
const TString fBranchName
TArrayProxy< TArrayType< UChar_t > > TArrayUCharProxy
TStlArrayProxy< TArrayType< ULong64_t > > TStlArrayULong64Proxy
TArrayProxy< TArrayType< Bool_t > > TArrayBoolProxy
TClaArrayProxy< TArrayType< UChar_t > > TClaArrayUCharProxy
TStlImpProxy< Int_t > TStlIntProxy
TClaImpProxy< UChar_t > TClaUCharProxy
virtual Int_t GetTreeNumber() const
TImpProxy< Int_t > TIntProxy
Int_t GetLast() const
Return index of last object in array.
const char * GetBranchName() const
TClaArrayProxy< TArrayType< UShort_t > > TClaArrayShortProxy
TClaArrayProxy< TArrayType< Long_t > > TClaArrayLongProxy
TStlImpProxy< ULong_t > TStlULongProxy
TStlImpProxy< Char_t > TStlCharProxy
TArrayProxy< TArrayType< Float16_t > > TArrayFloat16Proxy
virtual Int_t GetArrayLength()
TImpProxy< UChar_t > TUCharProxy
TClaImpProxy< Short_t > TClaShortProxy
char * Form(const char *fmt,...)
TArrayProxy< TArrayType< Int_t > > TArrayIntProxy
TClaArrayProxy< TArrayType< Double_t > > TClaArrayDoubleProxy
TClaArrayProxy< TArrayType< Float16_t > > TClaArrayFloat16Proxy
TClaArrayProxy< TArrayType< UShort_t > > TClaArrayUShortProxy
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
The ROOT global object gROOT contains a list of all defined classes.
TClaImpProxy< ULong_t > TClaULongProxy
void * GetStlStart(UInt_t i=0)
TClaImpProxy< Double_t > TClaDoubleProxy
void Reset(Detail::TBranchProxy *x)
TImpProxy< Short_t > TShortProxy
TImpProxy< Long_t > TLongProxy
TClaImpProxy< ULong64_t > TClaULong64Proxy
TClaImpProxy< Long64_t > TClaLong64Proxy
TStlImpProxy< Double32_t > TStlDouble32Proxy
Int_t GetEntries() override
const TVirtualCollectionProxy * GetPtr()
TClaImpProxy< Bool_t > TClaBoolProxy
TArrayProxy< TArrayType< ULong64_t > > TArrayULong64Proxy
TStlImpProxy< Float_t > TStlFloatProxy
virtual Int_t GetEntries()
TClaArrayProxy< TArrayType< Int_t > > TClaArrayIntProxy
virtual void PopProxy()=0
TClaImpProxy< Double32_t > TClaDouble32Proxy
void Print(std::ostream &os, const OptionType &opt)
Long64_t GetReadEntry() const
TVirtualCollectionProxy * GetCollection()
TImpProxy< ULong_t > TULongProxy
TStlImpProxy< UInt_t > TStlUIntProxy
TClaArrayProxy< TArrayType< Long64_t > > TClaArrayLong64Proxy
virtual void * At(UInt_t idx)=0
TStlArrayProxy< TArrayType< Char_t > > TStlArrayCharProxy
TClaArrayProxy< TArrayType< Double32_t > > TClaArrayDouble32Proxy
TImpProxy< Bool_t > TBoolProxy
TClaArrayProxy< TArrayType< Bool_t > > TClaArrayBoolProxy
TImpProxy< UShort_t > TUShortProxy
Internal::TBranchProxyDirector * fDirector
TStlImpProxy< Long_t > TStlLongProxy
TArrayProxy< TArrayType< Float_t > > TArrayFloatProxy
TStlImpProxy< UChar_t > TStlUCharProxy
TArrayProxy< TArrayType< UShort_t > > TArrayShortProxy
Binding & operator=(OUT(*fun)(void))
TImpProxy< UInt_t > TUIntProxy
virtual UInt_t Size() const =0
const TClonesArray * GetPtr()
TArrayProxy< TArrayType< UInt_t > > TArrayUIntProxy
virtual void * GetAddressOfElement(UInt_t)
Return the address of the element number i.
TStlArrayProxy< TArrayType< Float_t > > TStlArrayFloatProxy
TClaImpProxy< Int_t > TClaIntProxy
An array of clone (identical) objects.
TStlImpProxy< Double_t > TStlDoubleProxy
TBranchProxyHelper(const char *left, const char *right=0)
TStlArrayProxy< TArrayType< Long_t > > TStlArrayLongProxy
TImpProxy< Long64_t > TLong64Proxy
Int_t GetEntries() const
Return the number of objects in array (i.e.
TBranchProxy * GetProxy()
TClaImpProxy< Char_t > TClaCharProxy
TStlArrayProxy< TArrayType< UInt_t > > TStlArrayUIntProxy
TStlArrayProxy< TArrayType< Double32_t > > TStlArrayDouble32Proxy
A TTree object has a header with a name and a title.
const array_t & At(UInt_t i)
TStlImpProxy< Bool_t > TStlBoolProxy
TImpProxy< Float16_t > TFloat16Proxy
TClaArrayProxy< TArrayType< Float_t > > TClaArrayFloatProxy
Base class for all the proxy object.
Bool_t IsaPointer() const
A TTree is a list of TBranches.
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
TClaArrayProxy< TArrayType< ULong64_t > > TClaArrayULong64Proxy
TVirtualCollectionProxy * fCollection
unsigned char At(UInt_t i)
TClaArrayProxy< TArrayType< ULong_t > > TClaArrayULongProxy
void Error(ErrorHandler_t func, int code, const char *va_(fmt),...)
Write error message and call a handler, if required.
const char * Data() const
TStlImpProxy< UShort_t > TStlUShortProxy