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#include <string>
20
21// Forward declarations
23
24//______________________________________________________________________________
25//
26// TRefProxy is a reference proxy, which allows to access ROOT references (TRef)
27// stored contained in other objects from TTree::Draw
28//______________________________________________________________________________
29
31protected:
32 TClassRef fClass; //! Pointer to the reference class (TRef::Class())
33
34public:
35 /// Default constructor
36 TRefProxy() : fClass("TRef") {}
37 /// Copy constructor
39 /// Assignement operator
40 TRefProxy &operator=(const TRefProxy& c) { fClass =c.fClass; return *this; }
41
42 /// TVirtualRefProxy overload: Release the reference proxy (virtual destructor)
43 virtual void Release() { delete this; }
44 /// TVirtualRefProxy overload: Clone the reference proxy (virtual constructor)
45 virtual TVirtualRefProxy* Clone() const { return new TRefProxy(*this);}
46 /// TVirtualRefProxy overload: Setter of reference class (executed when the proxy is adopted)
47 virtual void SetClass(TClass *cl) { fClass = cl; }
48 /// TVirtualRefProxy overload: Getter of reference class (executed when the proxy is adopted)
49 virtual TClass * GetClass() const { return fClass; }
50 /// TVirtualRefProxy overload: Access to value class
51 virtual TClass* GetValueClass(void* data) const;
52 /// TVirtualRefProxy overload: Prepare reused reference object (e.g. ZERO data pointers)
53 virtual void* GetPreparedReference(void* data) { return data; }
54 /// TVirtualRefProxy overload: Update (and propagate) cached information
55 virtual Bool_t Update();
56 /// TVirtualRefProxy overload: Flag to indicate if this is a container reference
57 virtual Bool_t HasCounter() const { return kFALSE; }
58 /// TVirtualRefProxy overload: Access to container size (if container reference (ie TRefArray) etc)
59 virtual Int_t GetCounterValue(TFormLeafInfoReference* /* info */, void* /* data */)
60 { return 0; }
61 /// TVirtualRefProxy overload: Access referenced object(-data)
62 virtual void* GetObject(TFormLeafInfoReference* info, void* data, int instance);
63};
64#endif // ROOT_TRefProxy
#define c(i)
Definition: RSha256.hxx:101
int Int_t
Definition: RtypesCore.h:43
const Bool_t kFALSE
Definition: RtypesCore.h:90
bool Bool_t
Definition: RtypesCore.h:61
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:40
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:47
TClassRef fClass
Definition: TRefProxy.h:32
virtual Bool_t HasCounter() const
TVirtualRefProxy overload: Flag to indicate if this is a container reference.
Definition: TRefProxy.h:57
virtual TVirtualRefProxy * Clone() const
TVirtualRefProxy overload: Clone the reference proxy (virtual constructor)
Definition: TRefProxy.h:45
virtual void * GetPreparedReference(void *data)
TVirtualRefProxy overload: Prepare reused reference object (e.g. ZERO data pointers)
Definition: TRefProxy.h:53
TRefProxy(const TRefProxy &c)
Copy constructor.
Definition: TRefProxy.h:38
TRefProxy()
Pointer to the reference class (TRef::Class())
Definition: TRefProxy.h:36
virtual void Release()
TVirtualRefProxy overload: Release the reference proxy (virtual destructor)
Definition: TRefProxy.h:43
virtual Int_t GetCounterValue(TFormLeafInfoReference *, void *)
TVirtualRefProxy overload: Access to container size (if container reference (ie TRefArray) etc)
Definition: TRefProxy.h:59
virtual TClass * GetClass() const
TVirtualRefProxy overload: Getter of reference class (executed when the proxy is adopted)
Definition: TRefProxy.h:49
virtual void * GetObject(TFormLeafInfoReference *info, void *data, int instance)
TVirtualRefProxy overload: Access referenced object(-data)
Definition: TRefProxy.cxx:48
static Roo_reg_AGKInteg1D instance