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