Logo ROOT   6.08/07
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:
47  TNamedBranchProxy(): fDict(0), fContentDict(0) {}
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; }
53  Detail::TBranchProxy* GetProxy() { return &fProxy; }
54  TDictionary* GetDict() const { return fDict; }
55  void SetDict(TDictionary* dict) { fDict = dict; }
56  TDictionary* GetContentDict() const { return fContentDict; }
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
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
Definition: StringConv.hxx:21
const char * GetName() const
Returns name of object.
void SetContentDict(TDictionary *dict)
const Detail::TBranchProxy * GetProxy() const
#define ClassDef(name, id)
Definition: Rtypes.h:254
TNamedBranchProxy(TBranchProxyDirector *boss, TBranch *branch, const char *membername)
TDictionary * GetContentDict() const
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
Detail::TBranchProxy * GetProxy()
Mother of all ROOT objects.
Definition: TObject.h:37
A TTree object has a header with a name and a title.
Definition: TTree.h:98
Base class for all the proxy object.
Definition: TBranchProxy.h:81
A TTree is a list of TBranches.
Definition: TBranch.h:58