Logo ROOT  
Reference Guide
TFormLeafInfoReference.h
Go to the documentation of this file.
1 // @(#)root/treeplayer:$Id$
2 // Author: Markus Frank 01/02/2006
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers and al. *
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_TFormLeafInfoReference
13 #define ROOT_TFormLeafInfoReference
14 
15 #include "TFormLeafInfo.h"
16 
17 // Forward declarations
18 class TVirtualRefProxy;
19 
22 public:
23  Proxy* fProxy; //! Cached pointer to reference proxy
24  TBranch* fBranch; //! Cached pointer to branch object
25 public:
26  // Initializing constructor
27  TFormLeafInfoReference(TClass* classptr, TStreamerElement* element, int off);
28  // Copy constructor
30  // Default destructor
31  virtual ~TFormLeafInfoReference();
32  // Exception safe swap.
33  void Swap(TFormLeafInfoReference &other);
34  // Exception safe assignment operator.
36  // Virtual copy constructor
37  virtual TFormLeafInfo* DeepCopy() const;
38 
39  // Access to the info's proxy
40  Proxy* GetProxy() const { return fProxy; }
41  // Access to the info's connected branch
42  TBranch* GetBranch() const { return fBranch; }
43  // Access to the info's connected branch
44  void SetBranch(TBranch* branch)
45  { fBranch = branch; if ( fNext ) fNext->SetBranch(branch); }
46  // Access to the offset of the data
47  virtual Int_t GetOffset() const { return fOffset; }
48  // Return true only if the underlying data is an integral value
49  virtual Bool_t IsInteger() const { return kFALSE; }
50  // Return true only if the underlying data is a string
51  virtual Bool_t IsString() const { return kFALSE; }
52  // Return true only if the underlying data is a reference
53  virtual Bool_t IsReference() const { return kTRUE; }
54  // Access to target class pointer (if available)
55  virtual TClass* GetClass() const;
56  // Access to the value class of the reference proxy
57  virtual TClass* GetValueClass(TLeaf* from);
58  // Access to the value class from the object pointer
59  virtual TClass* GetValueClass(void* from);
60  // Return the address of the local value
61  virtual void *GetLocalValuePointer( TLeaf *from, Int_t instance = 0);
62  // Return the address of the local value
63  virtual void *GetLocalValuePointer(char *from, Int_t instance = 0);
64  // Return true if any of underlying data has a array size counter
65  virtual Bool_t HasCounter() const;
66  // Return the size of the underlying array for the current entry in the TTree.
67  virtual Int_t ReadCounterValue(char *where);
68  // Return the current size of the array container
69  virtual Int_t GetCounterValue(TLeaf* leaf);
70 
71  // Access value of referenced object (macro from TFormLeafInfo.g)
73  // Read value of referenced object
75  // TFormLeafInfo overload: Update (and propagate) cached information
76  virtual Bool_t Update();
77 };
78 
79 #endif /* ROOT_TFormLeafInfoReference */
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TFormLeafInfoReference::GetCounterValue
virtual Int_t GetCounterValue(TLeaf *leaf)
Return the current size of the array container.
Definition: TFormLeafInfoReference.cxx:124
TFormLeafInfoReference::GetProxy
Proxy * GetProxy() const
Definition: TFormLeafInfoReference.h:40
TFormLeafInfo::fNext
TFormLeafInfo * fNext
Definition: TFormLeafInfo.h:69
TFormLeafInfoReference::fProxy
Proxy * fProxy
Definition: TFormLeafInfoReference.h:23
TFormLeafInfoReference::operator=
TFormLeafInfoReference & operator=(const TFormLeafInfoReference &orig)
Exception safe assignment operator.
Definition: TFormLeafInfoReference.cxx:72
TFormLeafInfoReference::GetBranch
TBranch * GetBranch() const
Definition: TFormLeafInfoReference.h:42
TFormLeafInfo.h
Int_t
int Int_t
Definition: RtypesCore.h:45
TFormLeafInfoReference::DeepCopy
virtual TFormLeafInfo * DeepCopy() const
Virtual copy constructor.
Definition: TFormLeafInfoReference.cxx:82
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
bool
TFormLeafInfoReference::GetClass
virtual TClass * GetClass() const
Access to target class pointer (if available)
Definition: TFormLeafInfoReference.cxx:90
TFormLeafInfoReference::IsString
virtual Bool_t IsString() const
Return true if the underlying data is a string.
Definition: TFormLeafInfoReference.h:51
TFormLeafInfoReference::DECLARE_READVAL
DECLARE_READVAL
Definition: TFormLeafInfoReference.h:74
TBranch
A TTree is a list of TBranches.
Definition: TBranch.h:89
TFormLeafInfoReference::Update
virtual Bool_t Update()
TFormLeafInfo overload: Update (and propagate) cached information.
Definition: TFormLeafInfoReference.cxx:157
TFormLeafInfoReference::IsReference
virtual Bool_t IsReference() const
Definition: TFormLeafInfoReference.h:53
TFormLeafInfoReference::GetLocalValuePointer
virtual void * GetLocalValuePointer(TLeaf *from, Int_t instance=0)
This is implemented here because some compiler want ALL the signature of an overloaded function to be...
Definition: TFormLeafInfoReference.cxx:182
TFormLeafInfoReference::HasCounter
virtual Bool_t HasCounter() const
Return true if any of underlying data has a array size counter.
Definition: TFormLeafInfoReference.cxx:98
TVirtualRefProxy
Definition: TVirtualRefProxy.h:81
TLeaf
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:57
TFormLeafInfoReference::Swap
void Swap(TFormLeafInfoReference &other)
Exception safe swap.
Definition: TFormLeafInfoReference.cxx:62
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TFormLeafInfoReference::DECLARE_GETVAL
DECLARE_GETVAL
Definition: TFormLeafInfoReference.h:72
TFormLeafInfoReference::GetValueClass
virtual TClass * GetValueClass(TLeaf *from)
Access to the value class of the reference proxy.
Definition: TFormLeafInfoReference.cxx:141
TFormLeafInfoReference
A small helper class to implement the following of reference objects stored in a TTree.
Definition: TFormLeafInfoReference.h:20
TFormLeafInfo
This class is a small helper class to implement reading a data member on an object stored in a TTree.
Definition: TFormLeafInfo.h:49
RooFit_internal::instance
static Roo_reg_AGKInteg1D instance
Definition: RooAdaptiveGaussKronrodIntegrator1D.cxx:153
TFormLeafInfoReference::IsInteger
virtual Bool_t IsInteger() const
Return true if the underlying data is an integral value.
Definition: TFormLeafInfoReference.h:49
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TFormLeafInfoReference::~TFormLeafInfoReference
virtual ~TFormLeafInfoReference()
Destructor.
Definition: TFormLeafInfoReference.cxx:54
TFormLeafInfoReference::TFormLeafInfoReference
TFormLeafInfoReference(TClass *classptr, TStreamerElement *element, int off)
Cached pointer to branch object.
Definition: TFormLeafInfoReference.cxx:26
TFormLeafInfo::fOffset
Long_t fOffset
This is the class of the data pointed to.
Definition: TFormLeafInfo.h:64
TFormLeafInfoReference::Proxy
TVirtualRefProxy Proxy
Definition: TFormLeafInfoReference.h:21
TFormLeafInfo::SetBranch
virtual void SetBranch(TBranch *br)
Definition: TFormLeafInfo.h:113
TFormLeafInfoReference::fBranch
TBranch * fBranch
Cached pointer to reference proxy.
Definition: TFormLeafInfoReference.h:24
TFormLeafInfoReference::GetOffset
virtual Int_t GetOffset() const
Definition: TFormLeafInfoReference.h:47
TFormLeafInfoReference::ReadCounterValue
virtual Int_t ReadCounterValue(char *where)
Return the size of the underlying array for the current entry in the TTree.
Definition: TFormLeafInfoReference.cxx:107
TStreamerElement
Definition: TStreamerElement.h:33
TFormLeafInfoReference::SetBranch
void SetBranch(TBranch *branch)
Definition: TFormLeafInfoReference.h:44
int