Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TRefProxy.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/meta:$Id$
0002 // Author: Markus Frank 20/05/2005
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TRefProxy
0013 #define ROOT_TRefProxy
0014 
0015 #include "TVirtualRefProxy.h"
0016 
0017 #include "TClassRef.h"
0018 
0019 // Forward declarations
0020 class TFormLeafInfoReference;
0021 
0022 //______________________________________________________________________________
0023 //
0024 // TRefProxy is a reference proxy, which allows to access ROOT references (TRef)
0025 // stored contained in other objects from TTree::Draw
0026 //______________________________________________________________________________
0027 
0028 class TRefProxy : public TVirtualRefProxy  {
0029 protected:
0030    TClassRef fClass;    //! Pointer to the reference class (TRef::Class())
0031 
0032 public:
0033    /// Default constructor
0034    TRefProxy() : fClass("TRef") {}
0035    /// Copy constructor
0036    TRefProxy(const TRefProxy& c) : TVirtualRefProxy(), fClass(c.fClass) {}
0037    /// Assignement operator
0038    TRefProxy &operator=(const TRefProxy& c) { fClass =c.fClass; return *this; }
0039 
0040    /// TVirtualRefProxy overload: Release the reference proxy (virtual destructor)
0041    void Release() override                         { delete this;                }
0042    /// TVirtualRefProxy overload: Clone the reference proxy (virtual constructor)
0043    TVirtualRefProxy* Clone() const override        { return new TRefProxy(*this);}
0044    /// TVirtualRefProxy overload: Setter of reference class (executed when the proxy is adopted)
0045    void SetClass(TClass *cl) override              { fClass = cl;                }
0046    /// TVirtualRefProxy overload: Getter of reference class (executed when the proxy is adopted)
0047    TClass * GetClass() const override              { return fClass;              }
0048    /// TVirtualRefProxy overload: Access to value class
0049    TClass* GetValueClass(void* data) const override;
0050    /// TVirtualRefProxy overload: Prepare reused reference object (e.g. ZERO data pointers)
0051    void* GetPreparedReference(void* data) override {  return data;               }
0052    /// TVirtualRefProxy overload: Update (and propagate) cached information
0053    bool   Update() override;
0054    /// TVirtualRefProxy overload: Flag to indicate if this is a container reference
0055    bool   HasCounter()  const override             { return false;              }
0056    /// TVirtualRefProxy overload: Access to container size (if container reference (ie TRefArray) etc)
0057    Int_t  GetCounterValue(TFormLeafInfoReference* /* info */, void* /* data */) override
0058    {  return 0;                                                                 }
0059    /// TVirtualRefProxy overload: Access referenced object(-data)
0060    void* GetObject(TFormLeafInfoReference* info, void* data, int instance) override;
0061 };
0062 #endif // ROOT_TRefProxy