Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
19
22public:
23 Proxy* fProxy; ///<! Cached pointer to reference proxy
24 TBranch* fBranch; ///<! Cached pointer to branch object
25public:
26 /// Initializing constructor
27 TFormLeafInfoReference(TClass* classptr, TStreamerElement* element, int off);
28 /// Copy constructor
30 /// Default destructor
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 */
int Int_t
Definition RtypesCore.h:45
const Bool_t kFALSE
Definition RtypesCore.h:101
bool Bool_t
Definition RtypesCore.h:63
const Bool_t kTRUE
Definition RtypesCore.h:100
A TTree is a list of TBranches.
Definition TBranch.h:89
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition TClass.h:80
A small helper class to implement the following of reference objects stored in a TTree.
Proxy * GetProxy() const
Access to the info's proxy.
void SetBranch(TBranch *branch)
Access to the info's connected branch.
virtual Bool_t IsInteger() const
Return true only if the underlying data is an integral value.
virtual Int_t ReadCounterValue(char *where)
Return the size of the underlying array for the current entry in the TTree.
TBranch * fBranch
! Cached pointer to branch object
virtual Int_t GetCounterValue(TLeaf *leaf)
Return the current size of the array container.
virtual Bool_t IsReference() const
Return true only if the underlying data is a reference.
virtual TFormLeafInfo * DeepCopy() const
Virtual copy constructor.
Proxy * fProxy
! Cached pointer to reference proxy
DECLARE_GETVAL
Access value of referenced object (macro from TFormLeafInfo.g)
virtual Bool_t IsString() const
Return true only if the underlying data is a string.
virtual TClass * GetValueClass(TLeaf *from)
Access to the value class of the reference proxy.
DECLARE_READVAL
Read value of referenced object.
virtual ~TFormLeafInfoReference()
Default destructor.
virtual TClass * GetClass() const
Access to target class pointer (if available)
TBranch * GetBranch() const
Access to the info's connected branch.
virtual Bool_t Update()
TFormLeafInfo overload: Update (and propagate) cached information.
virtual Int_t GetOffset() const
Access to the offset of the data.
virtual Bool_t HasCounter() const
Return true if any of underlying data has a array size counter.
virtual void * GetLocalValuePointer(TLeaf *from, Int_t instance=0)
Return the address of the local value.
TFormLeafInfoReference & operator=(const TFormLeafInfoReference &orig)
Exception safe assignment operator.
This class is a small helper class to implement reading a data member on an object stored in a TTree.
virtual void SetBranch(TBranch *br)
TFormLeafInfo * fNext
follow this to grab the inside information
Longptr_t fOffset
! Offset of the data pointed inside the class fClass
A TLeaf describes individual elements of a TBranch See TBranch structure in TTree.
Definition TLeaf.h:57
#define Swap(a, b)
Definition geom.c:201