Logo ROOT   6.18/05
Reference Guide
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
29class TDictionary;
30class TTree;
31
32namespace ROOT {
33 namespace Detail {
34 class TBranchProxy;
35 }
36
37namespace Internal {
38 class TBranchProxyDirector;
39 class TTreeReaderArrayBase;
40
42 public:
44 TNamedBranchProxy(TBranchProxyDirector* boss, TBranch* branch, const char* fullname, const char* membername):
45 fProxy(boss, fullname, branch, membername), fDict(0), fContentDict(0), fFullName(fullname) {}
46
47 // Constructor for friend case, the fullname (containing the name of the friend tree) may be different
48 // from the lookup name (without the name of the friend)
49 TNamedBranchProxy(TBranchProxyDirector* boss, TBranch* branch, const char* fullname, const char* proxyname, const char* membername):
50 fProxy(boss, proxyname, branch, membername), fDict(0), fContentDict(0), fFullName(fullname) {}
51
52 const char* GetName() const { return fFullName.c_str(); }
53 const Detail::TBranchProxy* GetProxy() const { return &fProxy; }
55 TDictionary* GetDict() const { return fDict; }
56 void SetDict(TDictionary* dict) { fDict = dict; }
58 void SetContentDict(TDictionary* dict) { fContentDict = dict; }
59
60 private:
63 TDictionary* fContentDict; // type of content, if a collection
64 std::string fFullName;
65 };
66
67 // Used by TTreeReaderArray
69 public:
71
73
75 virtual size_t GetSize(Detail::TBranchProxy*) = 0;
76 virtual void* At(Detail::TBranchProxy*, size_t /*idx*/) = 0;
77 };
78
79}
80}
81
82#endif // defined TTreeReaderUtils
Base class for all the proxy object.
Definition: TBranchProxy.h:69
void SetDict(TDictionary *dict)
const Detail::TBranchProxy * GetProxy() const
Detail::TBranchProxy * GetProxy()
TDictionary * GetContentDict() const
void SetContentDict(TDictionary *dict)
TNamedBranchProxy(TBranchProxyDirector *boss, TBranch *branch, const char *fullname, const char *membername)
TNamedBranchProxy(TBranchProxyDirector *boss, TBranch *branch, const char *fullname, const char *proxyname, const char *membername)
Base class of TTreeReaderValue.
TTreeReaderValueBase::EReadStatus fReadStatus
virtual size_t GetSize(Detail::TBranchProxy *)=0
virtual void * At(Detail::TBranchProxy *, size_t)=0
A TTree is a list of TBranches.
Definition: TBranch.h:65
This class defines an abstract interface that must be implemented by all classes that contain diction...
Definition: TDictionary.h:159
A TTree represents a columnar dataset.
Definition: TTree.h:71
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21