ROOT  6.06/09
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 
25 #ifndef ROOT_TBranchProxyDirector
26 #include "TBranchProxyDirector.h"
27 #endif
28 #ifndef ROOT_TBranchProxy
29 #include "TBranchProxy.h"
30 #endif
31 #include "TTreeReaderValue.h"
32 
33 class TDictionary;
34 class TTree;
35 
36 namespace ROOT {
37  namespace Detail {
38  class TBranchProxy;
39  }
40 
41 namespace Internal {
42  class TBranchProxyDirector;
43  class TTreeReaderArrayBase;
44 
45  class TNamedBranchProxy: public TObject {
46  public:
48  TNamedBranchProxy(TBranchProxyDirector* boss, TBranch* branch, const char* membername):
49  fProxy(boss, branch, membername), fDict(0), fContentDict(0) {}
50 
51  const char* GetName() const { return fProxy.GetBranchName(); }
52  const Detail::TBranchProxy* GetProxy() const { return &fProxy; }
54  TDictionary* GetDict() const { return fDict; }
55  void SetDict(TDictionary* dict) { fDict = dict; }
57  void SetContentDict(TDictionary* dict) { fContentDict = dict; }
58 
59  private:
62  TDictionary* fContentDict; // type of content, if a collection
63  ClassDef(TNamedBranchProxy, 0); // branch proxy with a name
64  };
65 
66  // Used by TTreeReaderArray
68  public:
70 
71  TVirtualCollectionReader() : fReadStatus(TTreeReaderValueBase::kReadNothingYet) {}
72 
73  virtual ~TVirtualCollectionReader();
74  virtual size_t GetSize(Detail::TBranchProxy*) = 0;
75  virtual void* At(Detail::TBranchProxy*, size_t /*idx*/) = 0;
76  };
77 
78 }
79 }
80 
81 #endif // defined TTreeReaderUtils
Namespace for new ROOT classes and functions.
Definition: ROOT.py:1
ClassDef(TNamedBranchProxy, 0)
const Detail::TBranchProxy * GetProxy() const
void SetContentDict(TDictionary *dict)
TNamedBranchProxy(TBranchProxyDirector *boss, TBranch *branch, const char *membername)
TTreeReaderValueBase::EReadStatus fReadStatus
void SetDict(TDictionary *dict)
This class defines an abstract interface that must be implemented by all classes that contain diction...
Definition: TDictionary.h:162
const char * GetName() const
Returns name of object.
const char * GetBranchName() const
Definition: TBranchProxy.h:125
Detail::TBranchProxy * GetProxy()
Mother of all ROOT objects.
Definition: TObject.h:58
A TTree object has a header with a name and a title.
Definition: TTree.h:94
virtual void * At(Detail::TBranchProxy *, size_t)=0
TDictionary * GetContentDict() const
A TTree is a list of TBranches.
Definition: TBranch.h:58
TDictionary * GetDict() const
virtual size_t GetSize(Detail::TBranchProxy *)=0