Logo ROOT  
Reference Guide
TRefProxy.h
Go to the documentation of this file.
1 // @(#)root/meta:$Id$
2 // Author: Markus Frank 20/05/2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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_TRefProxy
13 #define ROOT_TRefProxy
14 
15 #include "TVirtualRefProxy.h"
16 
17 #include "TClassRef.h"
18 
19 // Forward declarations
21 
22 //______________________________________________________________________________
23 //
24 // TRefProxy is a reference proxy, which allows to access ROOT references (TRef)
25 // stored contained in other objects from TTree::Draw
26 //______________________________________________________________________________
27 
28 class TRefProxy : public TVirtualRefProxy {
29 protected:
30  TClassRef fClass; //! Pointer to the reference class (TRef::Class())
31 
32 public:
33  /// Default constructor
34  TRefProxy() : fClass("TRef") {}
35  /// Copy constructor
37  /// Assignement operator
38  TRefProxy &operator=(const TRefProxy& c) { fClass =c.fClass; return *this; }
39 
40  /// TVirtualRefProxy overload: Release the reference proxy (virtual destructor)
41  virtual void Release() { delete this; }
42  /// TVirtualRefProxy overload: Clone the reference proxy (virtual constructor)
43  virtual TVirtualRefProxy* Clone() const { return new TRefProxy(*this);}
44  /// TVirtualRefProxy overload: Setter of reference class (executed when the proxy is adopted)
45  virtual void SetClass(TClass *cl) { fClass = cl; }
46  /// TVirtualRefProxy overload: Getter of reference class (executed when the proxy is adopted)
47  virtual TClass * GetClass() const { return fClass; }
48  /// TVirtualRefProxy overload: Access to value class
49  virtual TClass* GetValueClass(void* data) const;
50  /// TVirtualRefProxy overload: Prepare reused reference object (e.g. ZERO data pointers)
51  virtual void* GetPreparedReference(void* data) { return data; }
52  /// TVirtualRefProxy overload: Update (and propagate) cached information
53  virtual Bool_t Update();
54  /// TVirtualRefProxy overload: Flag to indicate if this is a container reference
55  virtual Bool_t HasCounter() const { return kFALSE; }
56  /// TVirtualRefProxy overload: Access to container size (if container reference (ie TRefArray) etc)
57  virtual Int_t GetCounterValue(TFormLeafInfoReference* /* info */, void* /* data */)
58  { return 0; }
59  /// TVirtualRefProxy overload: Access referenced object(-data)
60  virtual void* GetObject(TFormLeafInfoReference* info, void* data, int instance);
61 };
62 #endif // ROOT_TRefProxy
c
#define c(i)
Definition: RSha256.hxx:101
TRefProxy::GetPreparedReference
virtual void * GetPreparedReference(void *data)
TVirtualRefProxy overload: Prepare reused reference object (e.g. ZERO data pointers)
Definition: TRefProxy.h:51
TRefProxy::GetCounterValue
virtual Int_t GetCounterValue(TFormLeafInfoReference *, void *)
TVirtualRefProxy overload: Access to container size (if container reference (ie TRefArray) etc)
Definition: TRefProxy.h:57
TRefProxy::operator=
TRefProxy & operator=(const TRefProxy &c)
Assignement operator.
Definition: TRefProxy.h:38
TRefProxy::fClass
TClassRef fClass
Definition: TRefProxy.h:30
TRefProxy::Update
virtual Bool_t Update()
TVirtualRefProxy overload: Update (and propagate) cached information.
Definition: TRefProxy.cxx:31
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TRefProxy::HasCounter
virtual Bool_t HasCounter() const
TVirtualRefProxy overload: Flag to indicate if this is a container reference.
Definition: TRefProxy.h:55
bool
TRefProxy::GetClass
virtual TClass * GetClass() const
TVirtualRefProxy overload: Getter of reference class (executed when the proxy is adopted)
Definition: TRefProxy.h:47
TRefProxy::Release
virtual void Release()
TVirtualRefProxy overload: Release the reference proxy (virtual destructor)
Definition: TRefProxy.h:41
TVirtualRefProxy
Definition: TVirtualRefProxy.h:81
TRefProxy::GetValueClass
virtual TClass * GetValueClass(void *data) const
TVirtualRefProxy overload: Access to value class.
Definition: TRefProxy.cxx:39
TRefProxy::GetObject
virtual void * GetObject(TFormLeafInfoReference *info, void *data, int instance)
TVirtualRefProxy overload: Access referenced object(-data)
Definition: TRefProxy.cxx:48
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TRefProxy::TRefProxy
TRefProxy(const TRefProxy &c)
Copy constructor.
Definition: TRefProxy.h:36
TRefProxy::Clone
virtual TVirtualRefProxy * Clone() const
TVirtualRefProxy overload: Clone the reference proxy (virtual constructor)
Definition: TRefProxy.h:43
TVirtualRefProxy.h
TFormLeafInfoReference
A small helper class to implement the following of reference objects stored in a TTree.
Definition: TFormLeafInfoReference.h:20
RooFit_internal::instance
static Roo_reg_AGKInteg1D instance
Definition: RooAdaptiveGaussKronrodIntegrator1D.cxx:153
TClassRef.h
TClass
TClass instances represent classes, structs and namespaces in the ROOT type system.
Definition: TClass.h:80
TRefProxy::TRefProxy
TRefProxy()
Pointer to the reference class (TRef::Class())
Definition: TRefProxy.h:34
TRefProxy::SetClass
virtual void SetClass(TClass *cl)
TVirtualRefProxy overload: Setter of reference class (executed when the proxy is adopted)
Definition: TRefProxy.h:45
TClassRef
TClassRef is used to implement a permanent reference to a TClass object.
Definition: TClassRef.h:28
TRefProxy
Definition: TRefProxy.h:28
int