Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TBranchProxy.h
Go to the documentation of this file.
1// @(#)root/treeplayer:$Id$
2// Author: Philippe Canal 01/06/2004
3
4/*************************************************************************
5 * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers and al. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TBranchProxy
13#define ROOT_TBranchProxy
14
16#include "TTree.h"
17#include "TBranch.h"
18#include "TLeaf.h"
19#include "TClonesArray.h"
20#include "TString.h"
21#include "TError.h"
23#include "TNotifyLink.h"
24
25#include <algorithm>
26#include <string>
27#include <iostream>
28
29class TBranch;
31
32// Note we could protect the arrays more by introducing a class TArrayWrapper<class T> which somehow knows
33// its internal dimensions and check for them ...
34// template <class T> TArrayWrapper {
35// public:
36// TArrayWrapper(void *where, int dim1);
37// const T operator[](int i) {
38// if (i>=dim1) return 0;
39// return where[i];
40// };
41// };
42// 2D array would actually be a wrapper of a wrapper i.e. has a method TArrayWrapper<T> operator[](int i);
43
44namespace ROOT {
45namespace Internal {
46 ////////////////////////////////////////////////////////////////////////////////
47 /// String builder to be used in the constructors.
49 public:
51 TBranchProxyHelper(const char *left, const char *right = nullptr) :
52 fName() {
53 if (left) {
54 fName = left;
55 if (left[0]&&right && fName[fName.Length()-1]!='.') fName += ".";
56 }
57 if (right) {
58 fName += right;
59 }
60 }
61 operator const char*() { return fName.Data(); }
62 };
63
65} // namespace Internal
66
67// prevent access violation when executing the df017_vecOpsHEP.C tutorial with ROOT built in release mode
68// TODO: to be reviewed when updating Visual Studio or LLVM
69#if defined(_MSC_VER) && !defined(__clang__)
70#pragma optimize("", off)
71#endif
72
73namespace Detail {
75 protected:
76 Internal::TBranchProxyDirector *fDirector; // contain pointer to TTree and entry to be read
77
79 const Bool_t fIsMember : 1; // true if we proxy an unsplit data member
80 Bool_t fIsClone : 1; // true if we proxy the inside of a TClonesArray
81 Bool_t fIsaPointer : 1; // true if we proxy a data member of pointer type
82 Bool_t fHasLeafCount : 1;// true if we proxy a variable size leaf of a leaflist
83
84 const TString fBranchName; // name of the branch to read
85 TBranchProxy *fParent; // Proxy to a parent object
86
87 const TString fDataMember; // name of the (eventual) data member being proxied
88
89
90 TString fClassName; // class name of the object pointed to by the branch
91 TClass *fClass; // class name of the object pointed to by the branch
94 Int_t fOffset; // Offset inside the object
95 Int_t fArrayLength; // Number of element if the data is an array
96
97 TBranch *fBranch; // branch to read
98 union {
99 TBranch *fBranchCount; // eventual auxiliary branch (for example holding the size)
100 TLeaf *fLeafCount; // eventual auxiliary leaf (for example holding the size)
101 };
102
103 TNotifyLink<TBranchProxy> fNotify; // Callback object used by the TChain to update this proxy
104
105 Long64_t fRead; // Last entry read
106
107 void *fWhere; // memory location of the data
108 TVirtualCollectionProxy *fCollection; // Handle to the collection containing the data chunk.
109
110 public:
111 virtual void Print();
112
113 TBranchProxy();
114 TBranchProxy(Internal::TBranchProxyDirector* boss, const char* top, const char* name = nullptr);
115 TBranchProxy(Internal::TBranchProxyDirector* boss, const char *top, const char *name, const char *membername);
116 TBranchProxy(Internal::TBranchProxyDirector* boss, TBranchProxy *parent, const char* membername, const char* top = nullptr, const char* name = nullptr);
117 TBranchProxy(Internal::TBranchProxyDirector* boss, TBranch* branch, const char* membername);
118 TBranchProxy(Internal::TBranchProxyDirector* boss, const char* branchname, TBranch* branch, const char* membername);
119 virtual ~TBranchProxy();
120
121 TBranchProxy* GetProxy() { return this; }
122 const char* GetBranchName() const { return fBranchName; }
123
124 void Reset();
125
127 fRead = -1;
128 return Setup();
129 }
130
131 Bool_t Setup();
132
134 return fInitialized;
135 // return fLastTree && fCurrentTreeNumber == fDirector->GetTree()->GetTreeNumber() && fLastTree == fDirector->GetTree();
136 }
137
139 return fIsaPointer;
140 }
141
143 if (R__unlikely(fDirector == nullptr)) return false;
144
145 auto treeEntry = fDirector->GetReadEntry();
146 if (treeEntry != fRead) {
147 if (!IsInitialized()) {
148 if (!Setup()) {
149 ::Error("TBranchProxy::Read","%s",Form("Unable to initialize %s\n",fBranchName.Data()));
150 return kFALSE;
151 }
152 }
154 if (fParent) {
155 result = fParent->Read();
156 } else {
157 if (fBranchCount) {
158 result &= (-1 != fBranchCount->GetEntry(treeEntry));
159 }
160 result &= (-1 != fBranch->GetEntry(treeEntry));
161 }
162 fRead = treeEntry;
164 fCollection->PopProxy(); // works even if no proxy env object was set.
165 if (IsaPointer()) {
166 fCollection->PushProxy( *(void**)fWhere );
167 } else {
169 }
170 }
171 return result;
172 } else {
173 return IsInitialized();
174 }
175 }
176
177private:
179
180 enum class EReadType {
181 kDefault,
192 };
193
195 if (fParent) {
196 if (!fCollection) {
198 } else {
199 if (IsaPointer()) {
201 } else {
203 }
204 }
205 } else {
206 if (fBranchCount) {
207 if (fCollection) {
208 if (IsaPointer()) {
210 } else {
212 }
213 } else {
215 }
216
217 } else {
218 if (fCollection) {
219 if (IsaPointer()) {
221 } else {
223 }
224 } else {
226 }
227 }
228 }
229 return EReadType::kDefault;
230 }
231
233 return false;
234 }
235
237 auto treeEntry = fDirector->GetReadEntry();
238 if (treeEntry != fRead) {
239 const Bool_t result = fParent->Read();
240 fRead = treeEntry;
241 return result;
242 } else {
243 return IsInitialized();
244 }
245 }
246
248 auto treeEntry = fDirector->GetReadEntry();
249 if (treeEntry != fRead) {
250 const Bool_t result = fParent->Read();
251 fRead = treeEntry;
252 fCollection->PopProxy(); // works even if no proxy env object was set.
254 return result;
255 } else {
256 return IsInitialized();
257 }
258 }
259
261 auto treeEntry = fDirector->GetReadEntry();
262 if (treeEntry != fRead) {
263 const Bool_t result = fParent->Read();
264 fRead = treeEntry;
265 fCollection->PopProxy(); // works even if no proxy env object was set.
266 fCollection->PushProxy( *(void**)fWhere );
267 return result;
268 } else {
269 return IsInitialized();
270 }
271 }
272
274 auto treeEntry = fDirector->GetReadEntry();
275 if (treeEntry != fRead) {
276 Bool_t result = (-1 != fBranch->GetEntry(treeEntry));
277 fRead = treeEntry;
278 fCollection->PopProxy(); // works even if no proxy env object was set.
279 fCollection->PushProxy( *(void**)fWhere );
280 return result;
281 } else {
282 return IsInitialized();
283 }
284 }
285
287 auto treeEntry = fDirector->GetReadEntry();
288 if (treeEntry != fRead) {
289 Bool_t result = (-1 != fBranch->GetEntry(treeEntry));
290 fRead = treeEntry;
291 fCollection->PopProxy(); // works even if no proxy env object was set.
293 return result;
294 } else {
295 return IsInitialized();
296 }
297 }
298
300 auto treeEntry = fDirector->GetReadEntry();
301 if (treeEntry != fRead) {
302 Bool_t result = (-1 != fBranch->GetEntry(treeEntry));
303 fRead = treeEntry;
304 return result;
305 } else {
306 return IsInitialized();
307 }
308 }
309
311 auto treeEntry = fDirector->GetReadEntry();
312 if (treeEntry != fRead) {
313 Bool_t result = (-1 != fBranchCount->GetEntry(treeEntry));
314 result &= (-1 != fBranch->GetEntry(treeEntry));
315 fRead = treeEntry;
316 fCollection->PopProxy(); // works even if no proxy env object was set.
317 fCollection->PushProxy( *(void**)fWhere );
318 return result;
319 } else {
320 return IsInitialized();
321 }
322 }
323
325 auto treeEntry = fDirector->GetReadEntry();
326 if (treeEntry != fRead) {
327 Bool_t result = (-1 != fBranchCount->GetEntry(treeEntry));
328 result &= (-1 != fBranch->GetEntry(treeEntry));
329 fRead = treeEntry;
330 fCollection->PopProxy(); // works even if no proxy env object was set.
332 return result;
333 } else {
334 return IsInitialized();
335 }
336 }
337
339 auto treeEntry = fDirector->GetReadEntry();
340 if (treeEntry != fRead) {
341 Bool_t result = (-1 != fBranchCount->GetEntry(treeEntry));
342 result &= (-1 != fBranch->GetEntry(treeEntry));
343 fRead = treeEntry;
344 return result;
345 } else {
346 return IsInitialized();
347 }
348 }
349
350public:
351
353 if (R__unlikely(fDirector == nullptr)) return false;
354
355 auto treeEntry = fDirector->GetReadEntry();
356 if (treeEntry != fRead) {
357 if (!IsInitialized()) {
358 if (!Setup()) {
359 ::Error("TBranchProxy::ReadEntries","%s",Form("Unable to initialize %s\n",fBranchName.Data()));
360 return false;
361 }
362 }
364 else {
365 if (fBranchCount) {
366 fBranchCount->TBranch::GetEntry(treeEntry);
367 }
368 fBranch->TBranch::GetEntry(treeEntry);
369 }
370 // NO - we only read the entries, not the contained objects!
371 // fRead = treeEntry;
372 }
373 return IsInitialized();
374 }
375
376 virtual Int_t GetEntries() {
377 if (!ReadEntries()) return 0;
378 if (!fHasLeafCount) {
379 return *(Int_t*)fLeafCount->GetValuePointer();
380 } else {
381 return 1;
382 }
383 }
384
386 return fArrayLength;
387 }
388
390 if (!fDirector) return nullptr;
391
392 if (fDirector->GetReadEntry() != fRead) {
393 if (!IsInitialized()) {
394 if (!Setup()) {
395 return nullptr;
396 }
397 }
398 }
399 return fClass;
400 }
401
402 void* GetWhere() const { return fWhere; } // intentionally non-virtual
403
404 /// Return the address of the element number i. Returns `nullptr` for non-collections. It assumed that Setip() has
405 /// been called.
406 virtual void *GetAddressOfElement(UInt_t /*i*/) {
407 return nullptr;
408 }
409
411
412 // protected:
413 virtual void *GetStart(UInt_t /*i*/=0) {
414 // return the address of the start of the object being proxied. Assumes
415 // that Setup() has been called.
416
417 if (fParent) {
418 fWhere = ((unsigned char*)fParent->GetStart()) + fMemberOffset;
419 }
420 if (IsaPointer()) {
421 if (fWhere) return *(void**)fWhere;
422 else return nullptr;
423 } else {
424 return fWhere;
425 }
426 }
427
428 void *GetClaStart(UInt_t i=0) {
429 // return the address of the start of the object being proxied. Assumes
430 // that Setup() has been called. Assumes the object containing this data
431 // member is held in TClonesArray.
432
433 char *location;
434
435 if (fIsClone) {
436
437 TClonesArray *tca;
438 tca = (TClonesArray*)GetStart();
439
440 if (!tca || tca->GetLast()<(Int_t)i) return nullptr;
441
442 location = (char*)tca->At(i);
443
444 return location;
445
446 } else if (fParent) {
447
448 //tcaloc = ((unsigned char*)fParent->GetStart());
449 location = (char*)fParent->GetClaStart(i);
450
451 } else {
452
453 void *tcaloc;
454 tcaloc = fWhere;
455 TClonesArray *tca;
456 tca = (TClonesArray*)tcaloc;
457
458 if (tca->GetLast()<(Int_t)i) return nullptr;
459
460 location = (char*)tca->At(i);
461 }
462
463 if (location) location += fOffset;
464 else return nullptr;
465
466 if (IsaPointer()) {
467 return *(void**)(location);
468 } else {
469 return location;
470 }
471
472 }
473
474 void *GetStlStart(UInt_t i=0) {
475 // return the address of the start of the object being proxied. Assumes
476 // that Setup() has been called. Assumes the object containing this data
477 // member is held in STL Collection.
478
479 char *location = nullptr;
480
481 if (fCollection) {
482
483 if (fCollection->Size()<i) return nullptr;
484
485 location = (char*)fCollection->At(i);
486
487 // return location;
488
489 } else if (fParent) {
490
491 //tcaloc = ((unsigned char*)fParent->GetStart());
492 location = (char*)fParent->GetStlStart(i);
493
494 } else {
495
496 R__ASSERT(0);
497 //void *tcaloc;
498 //tcaloc = fWhere;
499 //TClonesArray *tca;
500 //tca = (TClonesArray*)tcaloc;
501
502 //if (tca->GetLast()<i) return nullptr;
503
504 //location = (char*)tca->At(i);
505 }
506
507 if (location) location += fOffset;
508 else return nullptr;
509
510 if (IsaPointer()) {
511 return *(void**)(location);
512 } else {
513 return location;
514 }
515
516 }
517
518 Int_t GetOffset() { return fOffset; }
519 };
520} // namespace Detail
521
522#if defined(_MSC_VER) && !defined(__clang__)
523#pragma optimize("", on)
524#endif
525
526namespace Internal {
527
528 ////////////////////////////////////////////////////////////////////////////////
529 /// Concrete Implementation of the branch proxy around the data members which are array of char
531 public:
532 void Print() override {
534 std::cout << "fWhere " << fWhere << std::endl;
535 if (fWhere) std::cout << "value? " << *(unsigned char*)GetStart() << std::endl;
536 }
537
539 TArrayCharProxy() = default; // work around bug in GCC < 7
540 ~TArrayCharProxy() override = default;
541
543 if (!Read()) return nullptr;
544 unsigned char* str = (unsigned char*)GetStart();
545 return str + i;
546 }
547
548 unsigned char At(UInt_t i) {
549 static unsigned char default_val = {};
550 if (unsigned char* elAddr = (unsigned char*)GetAddressOfElement(i)) {
551 // should add out-of bound test
552 return *elAddr;
553 }
554 return default_val;
555 }
556
557 unsigned char operator [](Int_t i) {
558 return At(i);
559 }
560
561 unsigned char operator [](UInt_t i) {
562 return At(i);
563 }
564
565 operator const char*() {
566 if (!Read()) return "";
567 return (const char*)GetStart();
568 }
569
570 const char* Data() {
571 if (!Read()) return "";
572 return (const char*)GetStart();
573 }
574
575 const char* c_str() {
576 if (!Read()) return "";
577 return (const char*)GetStart();
578 }
579
580 operator std::string() {
581 if (!Read()) return "";
582 return std::string((const char*)GetStart());
583 }
584
585 };
586
587 ////////////////////////////////////////////////////////////////////////////////
588 /// Base class for the proxy around object in TClonesArray.
590 public:
591 void Print() override {
593 std::cout << "fWhere " << fWhere << std::endl;
594 if (fWhere) {
595 if (IsaPointer()) {
596 std::cout << "location " << *(TClonesArray**)fWhere << std::endl;
597 } else {
598 std::cout << "location " << fWhere << std::endl;
599 }
600 }
601 }
602
604 TClaProxy() = default; // work around bug in GCC < 7
605 ~TClaProxy() override = default;
606
608 if (!Read()) return nullptr;
609 return (TClonesArray*)GetStart();
610 }
611
612 Int_t GetEntries() override {
613 if (!ReadEntries()) return 0;
615 if (arr) return arr->GetEntries();
616 return 0;
617 }
618
620 if (!Read()) return nullptr;
621 if (!fWhere) return nullptr;
622 return GetClaStart(i);
623 }
624
625 const TClonesArray* operator->() { return GetPtr(); }
626
627 };
628
629 ////////////////////////////////////////////////////////////////////////////////
630 /// Base class for the proxy around STL containers.
632 public:
633 void Print() override {
635 std::cout << "fWhere " << fWhere << std::endl;
636 if (fWhere) {
637 if (IsaPointer()) {
638 std::cout << "location " << *(TClonesArray**)fWhere << std::endl;
639 } else {
640 std::cout << "location " << fWhere << std::endl;
641 }
642 }
643 }
644
646 TStlProxy() = default; // work around bug in GCC < 7
647 ~TStlProxy() override = default;
648
650 if (!Read()) return nullptr;
651 return GetCollection();
652 }
653
654 Int_t GetEntries() override {
655 if (!ReadEntries()) return 0;
656 return GetPtr()->Size();
657 }
658
660 if (!Read()) return nullptr;
661 if (!fWhere) return nullptr;
662 return GetStlStart(i);
663 }
664
666
667 };
668
669 ////////////////////////////////////////////////////////////////////////////////
670 /// Template of the proxy around objects.
671 template <class T>
673 public:
674 void Print() override {
676 std::cout << "fWhere " << fWhere << std::endl;
677 if (fWhere) std::cout << "value? " << *(T*)GetStart() << std::endl;
678 }
679
681 TImpProxy() = default; // work around bug in GCC < 7
682 ~TImpProxy() override = default;
683
684 operator T() {
685 if (!Read()) return 0;
686 return *(T*)GetStart();
687 }
688
689 // For now explicitly disable copying into the value (i.e. the proxy is read-only).
690 TImpProxy(T) = delete;
691 TImpProxy &operator=(T) = delete;
692
693 };
694
695 ////////////////////////////////////////////////////////////////////////////////
696 /// Helper template to be able to determine and
697 /// use array dimensions.
698 template <class T, int d = 0> struct TArrayType {
699 typedef T type_t;
700 typedef T array_t[d];
701 static constexpr int gSize = d;
702 };
703 ////////////////////////////////////////////////////////////////////////////////
704 /// Helper class for proxy around multi dimension array
705 template <class T> struct TArrayType<T,0> {
706 typedef T type_t;
707 typedef T array_t;
708 static constexpr int gSize = 0;
709 };
710 ////////////////////////////////////////////////////////////////////////////////
711 /// Helper class for proxy around multi dimension array
712 template <class T, int d> struct TMultiArrayType {
713 typedef typename T::type_t type_t;
714 typedef typename T::array_t array_t[d];
715 static constexpr int gSize = d;
716 };
717
718 ////////////////////////////////////////////////////////////////////////////////
719 /// Template for concrete implementation of proxy around array of T
720 template <class T>
722 public:
724 TArrayProxy() = default; // work around bug in GCC < 7
725 ~TArrayProxy() override = default;
726
727 typedef typename T::array_t array_t;
728 typedef typename T::type_t type_t;
729
730 void Print() override {
732 std::cout << "fWhere " << GetWhere() << std::endl;
733 if (GetWhere()) std::cout << "value? " << *(type_t*)GetWhere() << std::endl;
734 }
735
736 Int_t GetEntries() override {
737 return T::gSize;
738 }
739
741 if (!Read()) return nullptr;
742 if (array_t *arr = (array_t*)((type_t*)(GetStart())))
743 return &arr[i];
744 return nullptr;
745 }
746
747 const array_t &At(UInt_t i) {
748 static array_t default_val;
749 // should add out-of bound test
750 if (array_t *arr = (array_t*)GetAddressOfElement(i))
751 return *arr;
752 return default_val;
753 }
754
755 const array_t &operator [](Int_t i) { return At(i); }
756 const array_t &operator [](UInt_t i) { return At(i); }
757 };
758
759 ////////////////////////////////////////////////////////////////////////////////
760 /// Template of the Concrete Implementation of the branch proxy around TClonesArray of T
761 template <class T>
762 class TClaImpProxy : public TClaProxy {
763 public:
764
765 // void Print() override {
766 // TClaProxy::Print();
767 // }
768
770 TClaImpProxy() = default; // work around bug in GCC < 7
771 ~TClaImpProxy() override = default;
772
773 const T& At(UInt_t i) {
774 static T default_val;
775 if (void* addr = GetAddressOfElement(i))
776 return *(T*)addr;
777 return default_val;
778 }
779
780 const T& operator [](Int_t i) { return At(i); }
781 const T& operator [](UInt_t i) { return At(i); }
782
783 // For now explicitly disable copying into the value (i.e. the proxy is read-only).
784 TClaImpProxy(T) = delete;
786
787 };
788
789 ////////////////////////////////////////////////////////////////////////////////
790 /// Template of the Concrete Implementation of the branch proxy around an stl container of T
791 template <class T>
792 class TStlImpProxy : public TStlProxy {
793 public:
794
795 // void Print() override {
796 // TBranchProxy::Print();
797 // }
798
800 TStlImpProxy() = default; // work around bug in GCC < 7
801 ~TStlImpProxy() override = default;
802
803 const T& At(UInt_t i) {
804 static T default_val;
805 if (void* addr = GetAddressOfElement(i))
806 return *(T*)addr;
807 return default_val;
808 }
809
810 const T& operator [](Int_t i) { return At(i); }
811 const T& operator [](UInt_t i) { return At(i); }
812
813 // For now explicitly disable copying into the value (i.e. the proxy is read-only).
814 TStlImpProxy(T) = delete;
816
817 };
818
819 ////////////////////////////////////////////////////////////////////////////////
820 /// Template of the Concrete Implementation of the branch proxy around an TClonesArray of array of T
821 template <class T>
822 class TClaArrayProxy : public TClaProxy {
823 public:
824 typedef typename T::array_t array_t;
825 typedef typename T::type_t type_t;
826
827 // void Print() override {
828 // TClaProxy::Print();
829 // }
830
832 TClaArrayProxy() = default; // work around bug in GCC < 7
833 ~TClaArrayProxy() override = default;
834
835 /* const */ array_t *At(UInt_t i) {
836 static array_t default_val;
837 if (array_t* ptr = (array_t*)GetAddressOfElement(i))
838 return ptr; // no de-ref!
839
840 return &default_val;
841 }
842
843 /* const */ array_t *operator [](Int_t i) { return At(i); }
844 /* const */ array_t *operator [](UInt_t i) { return At(i); }
845 };
846
847
848 ////////////////////////////////////////////////////////////////////////////////
849 /// Template of the Concrete Implementation of the branch proxy around an stl container of array of T
850 template <class T>
851 class TStlArrayProxy : public TStlProxy {
852 public:
853 typedef typename T::array_t array_t;
854 typedef typename T::type_t type_t;
855
856 // void Print() override {
857 // TBranchProxy::Print();
858 // }
859
861 TStlArrayProxy() = default; // work around bug in GCC < 7
862 ~TStlArrayProxy() override = default;
863
864 /* const */ array_t *At(UInt_t i) {
865 static array_t default_val;
866 if (array_t* ptr = (array_t*)GetAddressOfElement(i))
867 return ptr; // no de-ref!
868 return &default_val;
869 }
870
871 /* const */ array_t *operator [](Int_t i) { return At(i); }
872 /* const */ array_t *operator [](UInt_t i) { return At(i); }
873 };
874
875 //TImpProxy<TObject> d;
876 typedef TImpProxy<Double_t> TDoubleProxy; // Concrete Implementation of the branch proxy around the data members which are double
877 typedef TImpProxy<Double32_t> TDouble32Proxy; // Concrete Implementation of the branch proxy around the data members which are double32
878 typedef TImpProxy<Float_t> TFloatProxy; // Concrete Implementation of the branch proxy around the data members which are float
879 typedef TImpProxy<Float16_t> TFloat16Proxy; // Concrete Implementation of the branch proxy around the data members which are float16
880 typedef TImpProxy<UInt_t> TUIntProxy; // Concrete Implementation of the branch proxy around the data members which are unsigned int
881 typedef TImpProxy<ULong_t> TULongProxy; // Concrete Implementation of the branch proxy around the data members which are unsigned long
882 typedef TImpProxy<ULong64_t> TULong64Proxy; // Concrete Implementation of the branch proxy around the data members which are unsigned long long
883 typedef TImpProxy<UShort_t> TUShortProxy; // Concrete Implementation of the branch proxy around the data members which are unsigned short
884 typedef TImpProxy<UChar_t> TUCharProxy; // Concrete Implementation of the branch proxy around the data members which are unsigned char
885 typedef TImpProxy<Int_t> TIntProxy; // Concrete Implementation of the branch proxy around the data members which are int
886 typedef TImpProxy<Long_t> TLongProxy; // Concrete Implementation of the branch proxy around the data members which are long
887 typedef TImpProxy<Long64_t> TLong64Proxy; // Concrete Implementation of the branch proxy around the data members which are long long
888 typedef TImpProxy<Short_t> TShortProxy; // Concrete Implementation of the branch proxy around the data members which are short
889 typedef TImpProxy<Char_t> TCharProxy; // Concrete Implementation of the branch proxy around the data members which are char
890 typedef TImpProxy<Bool_t> TBoolProxy; // Concrete Implementation of the branch proxy around the data members which are bool
891
892 typedef TArrayProxy<TArrayType<Double_t> > TArrayDoubleProxy; // Concrete Implementation of the branch proxy around the data members which are array of double
893 typedef TArrayProxy<TArrayType<Double32_t> > TArrayDouble32Proxy; // Concrete Implementation of the branch proxy around the data members which are array of double32
894 typedef TArrayProxy<TArrayType<Float_t> > TArrayFloatProxy; // Concrete Implementation of the branch proxy around the data members which are array of float
895 typedef TArrayProxy<TArrayType<Float16_t> > TArrayFloat16Proxy; // Concrete Implementation of the branch proxy around the data members which are array of float16
896 typedef TArrayProxy<TArrayType<UInt_t> > TArrayUIntProxy; // Concrete Implementation of the branch proxy around the data members which are array of unsigned int
897 typedef TArrayProxy<TArrayType<ULong_t> > TArrayULongProxy; // Concrete Implementation of the branch proxy around the data members which are array of unsigned long
898 typedef TArrayProxy<TArrayType<ULong64_t> > TArrayULong64Proxy; // Concrete Implementation of the branch proxy around the data members which are array of unsigned long long
899 typedef TArrayProxy<TArrayType<UShort_t> > TArrayUShortProxy; // Concrete Implementation of the branch proxy around the data members which are array of unsigned short
900 typedef TArrayProxy<TArrayType<UChar_t> > TArrayUCharProxy; // Concrete Implementation of the branch proxy around the data members which are array of unsigned char
901 typedef TArrayProxy<TArrayType<Int_t> > TArrayIntProxy; // Concrete Implementation of the branch proxy around the data members which are array of int
902 typedef TArrayProxy<TArrayType<Long_t> > TArrayLongProxy; // Concrete Implementation of the branch proxy around the data members which are array of long
903 typedef TArrayProxy<TArrayType<Long64_t> > TArrayLong64Proxy; // Concrete Implementation of the branch proxy around the data members which are array of long long
904 typedef TArrayProxy<TArrayType<UShort_t> > TArrayShortProxy; // Concrete Implementation of the branch proxy around the data members which are array of short
905 //specialized ! typedef TArrayProxy<TArrayType<Char_t> > TArrayCharProxy; // Concrete Implementation of the branch proxy around the data members which are array of char
906 typedef TArrayProxy<TArrayType<Bool_t> > TArrayBoolProxy; // Concrete Implementation of the branch proxy around the data members which are array of bool
907
908 typedef TClaImpProxy<Double_t> TClaDoubleProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are double
909 typedef TClaImpProxy<Double32_t> TClaDouble32Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are double32
910 typedef TClaImpProxy<Float_t> TClaFloatProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are float
911 typedef TClaImpProxy<Float16_t> TClaFloat16Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are float16
912 typedef TClaImpProxy<UInt_t> TClaUIntProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are unsigned int
913 typedef TClaImpProxy<ULong_t> TClaULongProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are unsigned long
914 typedef TClaImpProxy<ULong64_t> TClaULong64Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are unsigned long long
915 typedef TClaImpProxy<UShort_t> TClaUShortProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are unsigned short
916 typedef TClaImpProxy<UChar_t> TClaUCharProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are unsigned char
917 typedef TClaImpProxy<Int_t> TClaIntProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are int
918 typedef TClaImpProxy<Long_t> TClaLongProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are long
919 typedef TClaImpProxy<Long64_t> TClaLong64Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are long long
920 typedef TClaImpProxy<Short_t> TClaShortProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are short
921 typedef TClaImpProxy<Char_t> TClaCharProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are char
922 typedef TClaImpProxy<Bool_t> TClaBoolProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are bool
923
924 typedef TClaArrayProxy<TArrayType<Double_t> > TClaArrayDoubleProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of double
925 typedef TClaArrayProxy<TArrayType<Double32_t> > TClaArrayDouble32Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of double32
926 typedef TClaArrayProxy<TArrayType<Float_t> > TClaArrayFloatProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of float
927 typedef TClaArrayProxy<TArrayType<Float16_t> > TClaArrayFloat16Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of float16
928 typedef TClaArrayProxy<TArrayType<UInt_t> > TClaArrayUIntProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of unsigned int
929 typedef TClaArrayProxy<TArrayType<ULong_t> > TClaArrayULongProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of unsigned long
930 typedef TClaArrayProxy<TArrayType<ULong64_t> > TClaArrayULong64Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of unsigned long long
931 typedef TClaArrayProxy<TArrayType<UShort_t> > TClaArrayUShortProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of unsigned short
932 typedef TClaArrayProxy<TArrayType<UChar_t> > TClaArrayUCharProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of unsigned char
933 typedef TClaArrayProxy<TArrayType<Int_t> > TClaArrayIntProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of int
934 typedef TClaArrayProxy<TArrayType<Long_t> > TClaArrayLongProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of long
935 typedef TClaArrayProxy<TArrayType<Long64_t> > TClaArrayLong64Proxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of long long
936 typedef TClaArrayProxy<TArrayType<UShort_t> > TClaArrayShortProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of short
937 typedef TClaArrayProxy<TArrayType<Char_t> > TClaArrayCharProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of char
938 typedef TClaArrayProxy<TArrayType<Bool_t> > TClaArrayBoolProxy; // Concrete Implementation of the branch proxy around the data members of object in TClonesArray which are array of bool
939 //specialized ! typedef TClaArrayProxy<TArrayType<Char_t> > TClaArrayCharProxy;
940
941 typedef TStlImpProxy<Double_t> TStlDoubleProxy; // Concrete Implementation of the branch proxy around an stl container of double
942 typedef TStlImpProxy<Double32_t> TStlDouble32Proxy; // Concrete Implementation of the branch proxy around an stl container of double32
943 typedef TStlImpProxy<Float_t> TStlFloatProxy; // Concrete Implementation of the branch proxy around an stl container of float
944 typedef TStlImpProxy<Float16_t> TStlFloat16Proxy; // Concrete Implementation of the branch proxy around an stl container of float16_t
945 typedef TStlImpProxy<UInt_t> TStlUIntProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned int
946 typedef TStlImpProxy<ULong_t> TStlULongProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned long
947 typedef TStlImpProxy<ULong64_t> TStlULong64Proxy; // Concrete Implementation of the branch proxy around an stl container of unsigned long long
948 typedef TStlImpProxy<UShort_t> TStlUShortProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned short
949 typedef TStlImpProxy<UChar_t> TStlUCharProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned char
950 typedef TStlImpProxy<Int_t> TStlIntProxy; // Concrete Implementation of the branch proxy around an stl container of int
951 typedef TStlImpProxy<Long_t> TStlLongProxy; // Concrete Implementation of the branch proxy around an stl container of long
952 typedef TStlImpProxy<Long64_t> TStlLong64Proxy; // Concrete Implementation of the branch proxy around an stl container of long long
953 typedef TStlImpProxy<Short_t> TStlShortProxy; // Concrete Implementation of the branch proxy around an stl container of short
954 typedef TStlImpProxy<Char_t> TStlCharProxy; // Concrete Implementation of the branch proxy around an stl container of char
955 typedef TStlImpProxy<Bool_t> TStlBoolProxy; // Concrete Implementation of the branch proxy around an stl container of bool
956
957 typedef TStlArrayProxy<TArrayType<Double_t> > TStlArrayDoubleProxy; // Concrete Implementation of the branch proxy around an stl container of double
958 typedef TStlArrayProxy<TArrayType<Double32_t> > TStlArrayDouble32Proxy; // Concrete Implementation of the branch proxy around an stl container of double32
959 typedef TStlArrayProxy<TArrayType<Float_t> > TStlArrayFloatProxy; // Concrete Implementation of the branch proxy around an stl container of float
960 typedef TStlArrayProxy<TArrayType<Float16_t> > TStlArrayFloat16Proxy; // Concrete Implementation of the branch proxy around an stl container of float16_t
961 typedef TStlArrayProxy<TArrayType<UInt_t> > TStlArrayUIntProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned int
962 typedef TStlArrayProxy<TArrayType<ULong_t> > TStlArrayULongProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned long
963 typedef TStlArrayProxy<TArrayType<ULong64_t> > TStlArrayULong64Proxy; // Concrete Implementation of the branch proxy around an stl contained of unsigned long long
964 typedef TStlArrayProxy<TArrayType<UShort_t> > TStlArrayUShortProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned short
965 typedef TStlArrayProxy<TArrayType<UChar_t> > TStlArrayUCharProxy; // Concrete Implementation of the branch proxy around an stl container of unsigned char
966 typedef TStlArrayProxy<TArrayType<Int_t> > TStlArrayIntProxy; // Concrete Implementation of the branch proxy around an stl container of int
967 typedef TStlArrayProxy<TArrayType<Long_t> > TStlArrayLongProxy; // Concrete Implementation of the branch proxy around an stl container of long
968 typedef TStlArrayProxy<TArrayType<Long64_t> > TStlArrayLong64Proxy; // Concrete Implementation of the branch proxy around an stl container of long long
969 typedef TStlArrayProxy<TArrayType<UShort_t> > TStlArrayShortProxy; // Concrete Implementation of the branch proxy around an stl container of UShort_t
970 typedef TStlArrayProxy<TArrayType<Char_t> > TStlArrayCharProxy; // Concrete Implementation of the branch proxy around an stl container of char
971 typedef TStlArrayProxy<TArrayType<Bool_t> > TStlArrayBoolProxy; // Concrete Implementation of the branch proxy around an stl container of bool
972
973} // namespace Internal
974
975// Reasonably backward compatible.
977
978} // namespace ROOT
979
980#endif
981
#define R__unlikely(expr)
Definition RConfig.hxx:601
#define d(i)
Definition RSha256.hxx:102
int Int_t
Definition RtypesCore.h:45
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
long long Long64_t
Definition RtypesCore.h:80
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
#define R__ASSERT(e)
Definition TError.h:117
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Definition TError.cxx:197
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
char name[80]
Definition TGX11.cxx:110
char * Form(const char *fmt,...)
Formats a string in a circular formatting buffer.
Definition TString.cxx:2467
Base class for all the proxy object.
Bool_t ReadNoParentNoBranchCountNoCollection()
TNotifyLink< TBranchProxy > fNotify
Internal::TBranchProxyDirector * fDirector
Bool_t ReadNoParentNoBranchCountCollectionPointer()
TVirtualCollectionProxy * fCollection
void * GetClaStart(UInt_t i=0)
Bool_t Setup()
Initialize/cache the necessary information.
Bool_t ReadNoParentBranchCountCollectionNoPointer()
void * GetStlStart(UInt_t i=0)
const char * GetBranchName() const
virtual void * GetStart(UInt_t=0)
virtual Int_t GetArrayLength()
Bool_t ReadNoParentBranchCountNoCollection()
void Reset()
Completely reset the object.
virtual void * GetAddressOfElement(UInt_t)
Return the address of the element number i.
TBranchProxy * GetProxy()
Bool_t ReadNoParentNoBranchCountCollectionNoPointer()
virtual void Print()
Display the content of the object.
TVirtualCollectionProxy * GetCollection()
Bool_t ReadNoParentBranchCountCollectionPointer()
TStreamerElement * fElement
virtual ~TBranchProxy()
Typical Destructor.
Concrete Implementation of the branch proxy around the data members which are array of char.
~TArrayCharProxy() override=default
void Print() override
Display the content of the object.
unsigned char At(UInt_t i)
unsigned char operator[](Int_t i)
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
Template for concrete implementation of proxy around array of T.
void Print() override
Display the content of the object.
~TArrayProxy() override=default
const array_t & At(UInt_t i)
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
const array_t & operator[](Int_t i)
Int_t GetEntries() override
Long64_t GetReadEntry() const
Return the current 'local' entry number; i.e.
String builder to be used in the constructors.
TBranchProxyHelper(const char *left, const char *right=nullptr)
Template of the Concrete Implementation of the branch proxy around an TClonesArray of array of T.
array_t * operator[](Int_t i)
~TClaArrayProxy() override=default
Template of the Concrete Implementation of the branch proxy around TClonesArray of T.
~TClaImpProxy() override=default
TClaImpProxy & operator=(T)=delete
const T & operator[](Int_t i)
Base class for the proxy around object in TClonesArray.
Int_t GetEntries() override
const TClonesArray * operator->()
const TClonesArray * GetPtr()
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
~TClaProxy() override=default
void Print() override
Display the content of the object.
Template of the proxy around objects.
void Print() override
Display the content of the object.
~TImpProxy() override=default
TImpProxy & operator=(T)=delete
Template of the Concrete Implementation of the branch proxy around an stl container of array of T.
~TStlArrayProxy() override=default
array_t * operator[](Int_t i)
Template of the Concrete Implementation of the branch proxy around an stl container of T.
TStlImpProxy & operator=(T)=delete
const T & operator[](Int_t i)
~TStlImpProxy() override=default
Base class for the proxy around STL containers.
~TStlProxy() override=default
void * GetAddressOfElement(UInt_t i) final
Return the address of the element number i.
const TVirtualCollectionProxy * operator->()
Int_t GetEntries() override
void Print() override
Display the content of the object.
TVirtualCollectionProxy * GetPtr()
Base class of TTreeReaderValue.
A TTree is a list of TBranches.
Definition TBranch.h:89
virtual Int_t GetEntry(Long64_t entry=0, Int_t getall=0)
Read all leaves of entry and return total number of bytes read.
Definition TBranch.cxx:1652
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:81
An array of clone (identical) objects.
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition TLeaf.h:57
virtual void * GetValuePointer() const
Definition TLeaf.h:138
Int_t GetEntries() const override
Return the number of objects in array (i.e.
TObject * At(Int_t idx) const override
Definition TObjArray.h:164
Int_t GetLast() const override
Return index of last object in array.
Basic string class.
Definition TString.h:139
Ssiz_t Length() const
Definition TString.h:421
const char * Data() const
Definition TString.h:380
virtual void PushProxy(void *objectstart)=0
virtual void PopProxy()=0
virtual void * At(UInt_t idx)=0
virtual UInt_t Size() const =0
TImpProxy< Long_t > TLongProxy
TClaArrayProxy< TArrayType< ULong64_t > > TClaArrayULong64Proxy
TClaArrayProxy< TArrayType< Long64_t > > TClaArrayLong64Proxy
TClaArrayProxy< TArrayType< UChar_t > > TClaArrayUCharProxy
TStlImpProxy< UInt_t > TStlUIntProxy
TStlArrayProxy< TArrayType< Long64_t > > TStlArrayLong64Proxy
TClaArrayProxy< TArrayType< UShort_t > > TClaArrayShortProxy
TClaArrayProxy< TArrayType< Double32_t > > TClaArrayDouble32Proxy
TArrayProxy< TArrayType< Int_t > > TArrayIntProxy
TArrayProxy< TArrayType< UShort_t > > TArrayUShortProxy
TStlArrayProxy< TArrayType< ULong_t > > TStlArrayULongProxy
TStlImpProxy< ULong64_t > TStlULong64Proxy
TArrayProxy< TArrayType< Bool_t > > TArrayBoolProxy
TClaArrayProxy< TArrayType< Char_t > > TClaArrayCharProxy
TStlImpProxy< Double_t > TStlDoubleProxy
TStlArrayProxy< TArrayType< Int_t > > TStlArrayIntProxy
TStlArrayProxy< TArrayType< Float_t > > TStlArrayFloatProxy
TStlArrayProxy< TArrayType< Char_t > > TStlArrayCharProxy
TImpProxy< UShort_t > TUShortProxy
TStlArrayProxy< TArrayType< UShort_t > > TStlArrayShortProxy
TStlImpProxy< UChar_t > TStlUCharProxy
TClaImpProxy< Long_t > TClaLongProxy
TImpProxy< Double_t > TDoubleProxy
TImpProxy< ULong_t > TULongProxy
TStlArrayProxy< TArrayType< UChar_t > > TStlArrayUCharProxy
TArrayProxy< TArrayType< UChar_t > > TArrayUCharProxy
TClaImpProxy< Char_t > TClaCharProxy
TStlImpProxy< Char_t > TStlCharProxy
TClaImpProxy< Int_t > TClaIntProxy
TImpProxy< Long64_t > TLong64Proxy
TClaImpProxy< Bool_t > TClaBoolProxy
TStlImpProxy< Float16_t > TStlFloat16Proxy
TClaArrayProxy< TArrayType< Long_t > > TClaArrayLongProxy
TStlImpProxy< Float_t > TStlFloatProxy
TStlArrayProxy< TArrayType< Float16_t > > TStlArrayFloat16Proxy
TStlImpProxy< Long_t > TStlLongProxy
TArrayProxy< TArrayType< UInt_t > > TArrayUIntProxy
TImpProxy< UChar_t > TUCharProxy
TClaArrayProxy< TArrayType< Float_t > > TClaArrayFloatProxy
TImpProxy< Char_t > TCharProxy
TArrayProxy< TArrayType< UShort_t > > TArrayShortProxy
TClaArrayProxy< TArrayType< Int_t > > TClaArrayIntProxy
TImpProxy< ULong64_t > TULong64Proxy
TArrayProxy< TArrayType< Double_t > > TArrayDoubleProxy
TClaImpProxy< Long64_t > TClaLong64Proxy
TArrayProxy< TArrayType< ULong64_t > > TArrayULong64Proxy
TImpProxy< Int_t > TIntProxy
TClaArrayProxy< TArrayType< UInt_t > > TClaArrayUIntProxy
TClaImpProxy< Short_t > TClaShortProxy
TClaArrayProxy< TArrayType< UShort_t > > TClaArrayUShortProxy
TStlImpProxy< Bool_t > TStlBoolProxy
TArrayProxy< TArrayType< Float_t > > TArrayFloatProxy
TImpProxy< Float16_t > TFloat16Proxy
TStlArrayProxy< TArrayType< UInt_t > > TStlArrayUIntProxy
TStlArrayProxy< TArrayType< Bool_t > > TStlArrayBoolProxy
TClaImpProxy< Double32_t > TClaDouble32Proxy
TStlArrayProxy< TArrayType< Double32_t > > TStlArrayDouble32Proxy
TClaImpProxy< UInt_t > TClaUIntProxy
TArrayProxy< TArrayType< ULong_t > > TArrayULongProxy
TStlImpProxy< Int_t > TStlIntProxy
TClaImpProxy< Double_t > TClaDoubleProxy
TClaImpProxy< ULong_t > TClaULongProxy
TArrayProxy< TArrayType< Long64_t > > TArrayLong64Proxy
TClaImpProxy< ULong64_t > TClaULong64Proxy
TImpProxy< Double32_t > TDouble32Proxy
TClaArrayProxy< TArrayType< ULong_t > > TClaArrayULongProxy
TImpProxy< UInt_t > TUIntProxy
TClaImpProxy< UChar_t > TClaUCharProxy
TClaImpProxy< Float_t > TClaFloatProxy
TImpProxy< Float_t > TFloatProxy
TClaImpProxy< UShort_t > TClaUShortProxy
TArrayProxy< TArrayType< Float16_t > > TArrayFloat16Proxy
TImpProxy< Short_t > TShortProxy
TArrayProxy< TArrayType< Long_t > > TArrayLongProxy
TStlImpProxy< Double32_t > TStlDouble32Proxy
TStlArrayProxy< TArrayType< UShort_t > > TStlArrayUShortProxy
TClaArrayProxy< TArrayType< Double_t > > TClaArrayDoubleProxy
TStlArrayProxy< TArrayType< ULong64_t > > TStlArrayULong64Proxy
TStlArrayProxy< TArrayType< Long_t > > TStlArrayLongProxy
TStlImpProxy< UShort_t > TStlUShortProxy
TClaImpProxy< Float16_t > TClaFloat16Proxy
TClaArrayProxy< TArrayType< Bool_t > > TClaArrayBoolProxy
TStlImpProxy< Long64_t > TStlLong64Proxy
TStlImpProxy< Short_t > TStlShortProxy
TImpProxy< Bool_t > TBoolProxy
TClaArrayProxy< TArrayType< Float16_t > > TClaArrayFloat16Proxy
TStlImpProxy< ULong_t > TStlULongProxy
TStlArrayProxy< TArrayType< Double_t > > TStlArrayDoubleProxy
TArrayProxy< TArrayType< Double32_t > > TArrayDouble32Proxy
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
Helper template to be able to determine and use array dimensions.
static constexpr int gSize
Helper class for proxy around multi dimension array.