Logo ROOT   6.10/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 #include "TBranchProxyDirector.h"
26 #include "TBranchProxy.h"
27 #include "TTreeReaderValue.h"
28 
29 class TDictionary;
30 class TTree;
31 
32 namespace ROOT {
33  namespace Detail {
34  class TBranchProxy;
35  }
36 
37 namespace Internal {
38  class TBranchProxyDirector;
39  class TTreeReaderArrayBase;
40 
42  public:
43  TNamedBranchProxy(): fDict(0), fContentDict(0) {}
44  TNamedBranchProxy(TBranchProxyDirector* boss, TBranch* branch, const char* fullname, const char* membername):
45  fProxy(boss, branch, membername), fDict(0), fContentDict(0), fFullName(fullname) {}
46 
47  const char* GetName() const { return fFullName.c_str(); }
48  const Detail::TBranchProxy* GetProxy() const { return &fProxy; }
49  Detail::TBranchProxy* GetProxy() { return &fProxy; }
50  TDictionary* GetDict() const { return fDict; }
51  void SetDict(TDictionary* dict) { fDict = dict; }
52  TDictionary* GetContentDict() const { return fContentDict; }
53  void SetContentDict(TDictionary* dict) { fContentDict = dict; }
54 
55  private:
58  TDictionary* fContentDict; // type of content, if a collection
59  std::string fFullName;
60  };
61 
62  // Used by TTreeReaderArray
64  public:
66 
67  TVirtualCollectionReader() : fReadStatus(TTreeReaderValueBase::kReadNothingYet) {}
68 
69  virtual ~TVirtualCollectionReader();
70  virtual size_t GetSize(Detail::TBranchProxy*) = 0;
71  virtual void* At(Detail::TBranchProxy*, size_t /*idx*/) = 0;
72  };
73 
74 }
75 }
76 
77 #endif // defined TTreeReaderUtils
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
TNamedBranchProxy(TBranchProxyDirector *boss, TBranch *branch, const char *fullname, const char *membername)
void SetContentDict(TDictionary *dict)
const Detail::TBranchProxy * GetProxy() const
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:158
Detail::TBranchProxy * GetProxy()
A TTree object has a header with a name and a title.
Definition: TTree.h:78
Base class for all the proxy object.
Definition: TBranchProxy.h:65
A TTree is a list of TBranches.
Definition: TBranch.h:57