ROOT  6.06/09
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 #ifndef ROOT_TFormLeafInfo
16 #include "TFormLeafInfo.h"
17 #endif
18 
19 #include <string>
20 
21 // Forward declarations
22 class TVirtualRefProxy;
23 
26 public:
27  Proxy* fProxy; //! Cached pointer to reference proxy
28  TBranch* fBranch; //! Cached pointer to branch object
29 public:
30  // Initializing constructor
31  TFormLeafInfoReference(TClass* classptr, TStreamerElement* element, int off);
32  // Copy constructor
34  // Default destructor
35  virtual ~TFormLeafInfoReference();
36  // Exception safe swap.
37  void Swap(TFormLeafInfoReference &other);
38  // Exception safe assignment operator.
40  // Virtual copy constructor
41  virtual TFormLeafInfo* DeepCopy() const;
42 
43  // Access to the info's proxy
44  Proxy* GetProxy() const { return fProxy; }
45  // Access to the info's connected branch
46  TBranch* GetBranch() const { return fBranch; }
47  // Access to the info's connected branch
48  void SetBranch(TBranch* branch)
49  { fBranch = branch; if ( fNext ) fNext->SetBranch(branch); }
50  // Access to the offset of the data
51  virtual Int_t GetOffset() const { return fOffset; }
52  // Return true only if the underlying data is an integral value
53  virtual Bool_t IsInteger() const { return kFALSE; }
54  // Return true only if the underlying data is a string
55  virtual Bool_t IsString() const { return kFALSE; }
56  // Return true only if the underlying data is a reference
57  virtual Bool_t IsReference() const { return kTRUE; }
58  // Access to target class pointer (if available)
59  virtual TClass* GetClass() const;
60  // Access to the value class of the reference proxy
61  virtual TClass* GetValueClass(TLeaf* from);
62  // Access to the value class from the object pointer
63  virtual TClass* GetValueClass(void* from);
64  // Return the address of the local value
65  virtual void *GetLocalValuePointer( TLeaf *from, Int_t instance = 0);
66  // Return the address of the local value
67  virtual void *GetLocalValuePointer(char *from, Int_t instance = 0);
68  // Return true if any of underlying data has a array size counter
69  virtual Bool_t HasCounter() const;
70  // Return the size of the underlying array for the current entry in the TTree.
71  virtual Int_t ReadCounterValue(char *where);
72  // Return the current size of the array container
73  virtual Int_t GetCounterValue(TLeaf* leaf);
74 
75  // Access value of referenced object (macro from TFormLeafInfo.g)
77  // Read value of referenced object
79  // TFormLeafInfo overload: Update (and propagate) cached information
80  virtual Bool_t Update();
81 };
82 #endif /* ROOT_TFormLeafInfoReference */
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition: TLeaf.h:37
A small helper class to implement the following of reference objects stored in a TTree.
TFormLeafInfoReference(TClass *classptr, TStreamerElement *element, int off)
Cached pointer to branch object.
TFormLeafInfoReference & operator=(const TFormLeafInfoReference &orig)
Exception safe assignment operator.
TFormLeafInfo * fNext
Definition: TFormLeafInfo.h:73
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
virtual Int_t GetCounterValue(TLeaf *leaf)
Return the current size of the array container.
virtual Bool_t Update()
TFormLeafInfo overload: Update (and propagate) cached information.
virtual Bool_t IsReference() const
void Swap(TFormLeafInfoReference &other)
Exception safe swap.
virtual TClass * GetClass() const
Access to target class pointer (if available)
virtual ~TFormLeafInfoReference()
Destructor.
virtual Bool_t IsString() const
Return true if the underlying data is a string.
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
TBranch * fBranch
Cached pointer to reference proxy.
void SetBranch(TBranch *branch)
virtual void SetBranch(TBranch *br)
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...
virtual Bool_t HasCounter() const
Return true if any of underlying data has a array size counter.
This class is a small helper class to implement reading a data member on an object stored in a TTree...
Definition: TFormLeafInfo.h:53
virtual TClass * GetValueClass(TLeaf *from)
Access to the value class of the reference proxy.
virtual Bool_t IsInteger() const
Return true if the underlying data is an integral value.
TBranch * GetBranch() const
virtual Int_t GetOffset() const
Long_t fOffset
This is the class of the data pointed to.
Definition: TFormLeafInfo.h:68
virtual TFormLeafInfo * DeepCopy() const
Virtual copy constructor.
virtual Int_t ReadCounterValue(char *where)
Return the size of the underlying array for the current entry in the TTree.
A TTree is a list of TBranches.
Definition: TBranch.h:58
const Bool_t kTRUE
Definition: Rtypes.h:91