Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TTreeReaderUtils.h
Go to the documentation of this file.
1// @(#)root/tree:$Id$
2// Author: Axel Naumann, 2010-10-12
3
4/*************************************************************************
5 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
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_TTreeReaderUtils
13#define ROOT_TTreeReaderUtils
14
15
16////////////////////////////////////////////////////////////////////////////
17// //
18// TTreeReaderUtils //
19// //
20// TTreeReader's helpers. //
21// //
22// //
23////////////////////////////////////////////////////////////////////////////
24
26#include "TBranchProxy.h"
27#include "TTreeReaderValue.h"
28
29#include <string>
30
31class TDictionary;
32class TTree;
33
34namespace ROOT {
35 namespace Detail {
36 class TBranchProxy;
37 }
38
39namespace Internal {
41 class TTreeReaderArrayBase;
42
44 public:
45 TNamedBranchProxy() : fDict(nullptr), fContentDict(nullptr) {}
46 TNamedBranchProxy(TBranchProxyDirector *boss, TBranch *branch, const char *fullname, const char *membername,
47 bool suppressMissingBranchError)
48 : fProxy(boss, fullname, branch, membername, suppressMissingBranchError),
49 fDict(nullptr),
50 fContentDict(nullptr),
51 fFullName(fullname)
52 {
53 }
54
55 // Constructor for friend case, the fullname (containing the name of the friend tree) may be different
56 // from the lookup name (without the name of the friend)
57 TNamedBranchProxy(TBranchProxyDirector *boss, TBranch *branch, const char *fullname, const char *proxyname,
58 const char *membername, bool suppressMissingBranchError)
59 : fProxy(boss, proxyname, branch, membername, suppressMissingBranchError),
60 fDict(nullptr),
61 fContentDict(nullptr),
62 fFullName(fullname)
63 {
64 }
65
66 const char* GetName() const { return fFullName.c_str(); }
67 const Detail::TBranchProxy* GetProxy() const { return &fProxy; }
69 TDictionary* GetDict() const { return fDict; }
70 void SetDict(TDictionary* dict) { fDict = dict; }
72 void SetContentDict(TDictionary* dict) { fContentDict = dict; }
73
74 private:
77 TDictionary* fContentDict; // type of content, if a collection
78 std::string fFullName;
79 };
80
81 // Used by TTreeReaderArray
83 public:
85
87
89 virtual size_t GetSize(Detail::TBranchProxy*) = 0;
90 virtual void* At(Detail::TBranchProxy*, size_t /*idx*/) = 0;
91 };
92
93}
94}
95
96#endif // defined TTreeReaderUtils
Base class for all the proxy object.
void SetDict(TDictionary *dict)
const Detail::TBranchProxy * GetProxy() const
Detail::TBranchProxy * GetProxy()
TDictionary * GetContentDict() const
TNamedBranchProxy(TBranchProxyDirector *boss, TBranch *branch, const char *fullname, const char *membername, bool suppressMissingBranchError)
TNamedBranchProxy(TBranchProxyDirector *boss, TBranch *branch, const char *fullname, const char *proxyname, const char *membername, bool suppressMissingBranchError)
void SetContentDict(TDictionary *dict)
Base class of TTreeReaderValue.
TTreeReaderValueBase::EReadStatus fReadStatus
virtual size_t GetSize(Detail::TBranchProxy *)=0
virtual void * At(Detail::TBranchProxy *, size_t)=0
This class is used to 'drive' and hold a serie of TBranchProxy objects which represent and give acces...
A TTree is a list of TBranches.
Definition TBranch.h:93
This class defines an abstract interface that must be implemented by all classes that contain diction...
A TTree represents a columnar dataset.
Definition TTree.h:79
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...