Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
29protected:
30 TClassRef fClass; //! Pointer to the reference class (TRef::Class())
31
32public:
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
#define c(i)
Definition RSha256.hxx:101
const Bool_t kFALSE
Definition RtypesCore.h:92
bool Bool_t
Definition RtypesCore.h:63
TClassRef is used to implement a permanent reference to a TClass object.
Definition TClassRef.h:28
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.
TRefProxy & operator=(const TRefProxy &c)
Assignement operator.
Definition TRefProxy.h:38
virtual Bool_t Update()
TVirtualRefProxy overload: Update (and propagate) cached information.
Definition TRefProxy.cxx:31
virtual TClass * GetValueClass(void *data) const
TVirtualRefProxy overload: Access to value class.
Definition TRefProxy.cxx:39
virtual void SetClass(TClass *cl)
TVirtualRefProxy overload: Setter of reference class (executed when the proxy is adopted)
Definition TRefProxy.h:45
TClassRef fClass
Definition TRefProxy.h:30
virtual Bool_t HasCounter() const
TVirtualRefProxy overload: Flag to indicate if this is a container reference.
Definition TRefProxy.h:55
virtual TVirtualRefProxy * Clone() const
TVirtualRefProxy overload: Clone the reference proxy (virtual constructor)
Definition TRefProxy.h:43
virtual void * GetPreparedReference(void *data)
TVirtualRefProxy overload: Prepare reused reference object (e.g. ZERO data pointers)
Definition TRefProxy.h:51
TRefProxy(const TRefProxy &c)
Copy constructor.
Definition TRefProxy.h:36
TRefProxy()
Pointer to the reference class (TRef::Class())
Definition TRefProxy.h:34
virtual void Release()
TVirtualRefProxy overload: Release the reference proxy (virtual destructor)
Definition TRefProxy.h:41
virtual Int_t GetCounterValue(TFormLeafInfoReference *, void *)
TVirtualRefProxy overload: Access to container size (if container reference (ie TRefArray) etc)
Definition TRefProxy.h:57
virtual TClass * GetClass() const
TVirtualRefProxy overload: Getter of reference class (executed when the proxy is adopted)
Definition TRefProxy.h:47
virtual void * GetObject(TFormLeafInfoReference *info, void *data, int instance)
TVirtualRefProxy overload: Access referenced object(-data)
Definition TRefProxy.cxx:48