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 void Release() override { delete this; }
42 /// TVirtualRefProxy overload: Clone the reference proxy (virtual constructor)
43 TVirtualRefProxy* Clone() const override { return new TRefProxy(*this);}
44 /// TVirtualRefProxy overload: Setter of reference class (executed when the proxy is adopted)
45 void SetClass(TClass *cl) override { fClass = cl; }
46 /// TVirtualRefProxy overload: Getter of reference class (executed when the proxy is adopted)
47 TClass * GetClass() const override { return fClass; }
48 /// TVirtualRefProxy overload: Access to value class
49 TClass* GetValueClass(void* data) const override;
50 /// TVirtualRefProxy overload: Prepare reused reference object (e.g. ZERO data pointers)
51 void* GetPreparedReference(void* data) override { return data; }
52 /// TVirtualRefProxy overload: Update (and propagate) cached information
53 bool Update() override;
54 /// TVirtualRefProxy overload: Flag to indicate if this is a container reference
55 bool HasCounter() const override { return false; }
56 /// TVirtualRefProxy overload: Access to container size (if container reference (ie TRefArray) etc)
57 Int_t GetCounterValue(TFormLeafInfoReference* /* info */, void* /* data */) override
58 { return 0; }
59 /// TVirtualRefProxy overload: Access referenced object(-data)
60 void* GetObject(TFormLeafInfoReference* info, void* data, int instance) override;
61};
62#endif // ROOT_TRefProxy
#define c(i)
Definition RSha256.hxx:101
static Roo_reg_AGKInteg1D instance
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
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:81
A small helper class to implement the following of reference objects stored in a TTree.
TClass * GetValueClass(void *data) const override
TVirtualRefProxy overload: Access to value class.
Definition TRefProxy.cxx:39
TVirtualRefProxy * Clone() const override
TVirtualRefProxy overload: Clone the reference proxy (virtual constructor)
Definition TRefProxy.h:43
TRefProxy & operator=(const TRefProxy &c)
Assignement operator.
Definition TRefProxy.h:38
Int_t GetCounterValue(TFormLeafInfoReference *, void *) override
TVirtualRefProxy overload: Access to container size (if container reference (ie TRefArray) etc)
Definition TRefProxy.h:57
void * GetPreparedReference(void *data) override
TVirtualRefProxy overload: Prepare reused reference object (e.g. ZERO data pointers)
Definition TRefProxy.h:51
TClassRef fClass
Definition TRefProxy.h:30
void SetClass(TClass *cl) override
TVirtualRefProxy overload: Setter of reference class (executed when the proxy is adopted)
Definition TRefProxy.h:45
TClass * GetClass() const override
TVirtualRefProxy overload: Getter of reference class (executed when the proxy is adopted)
Definition TRefProxy.h:47
bool Update() override
TVirtualRefProxy overload: Update (and propagate) cached information.
Definition TRefProxy.cxx:31
void Release() override
TVirtualRefProxy overload: Release the reference proxy (virtual destructor)
Definition TRefProxy.h:41
void * GetObject(TFormLeafInfoReference *info, void *data, int instance) override
TVirtualRefProxy overload: Access referenced object(-data)
Definition TRefProxy.cxx:48
bool HasCounter() const override
TVirtualRefProxy overload: Flag to indicate if this is a container reference.
Definition TRefProxy.h:55
TRefProxy(const TRefProxy &c)
Copy constructor.
Definition TRefProxy.h:36
TRefProxy()
Pointer to the reference class (TRef::Class())
Definition TRefProxy.h:34