Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/cont:$Id$
0002 // Author: Rene Brun   28/09/2001
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_TRef
0013 #define ROOT_TRef
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TRef                                                                 //
0019 //                                                                      //
0020 // Persistent Reference link to a TObject                               //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 
0025 #include "TObject.h"
0026 
0027 class TProcessID;
0028 class TFile;
0029 class TExec;
0030 class TObjArray;
0031 
0032 class TRef : public TObject {
0033 
0034 protected:
0035    TProcessID       *fPID;     //!Pointer to ProcessID when TRef was written
0036 
0037    static TObjArray  *fgExecs;  //List of execs
0038    static TObject    *fgObject; //In: this, Out: pointer to object (used by Action on Demand)
0039 
0040 public:
0041 
0042    TRef(): fPID(nullptr) {}
0043    TRef(TObject *obj);
0044    TRef(const TRef &ref);
0045    void  operator=(TObject *obj);
0046    TRef& operator=(const TRef &ref);
0047    virtual ~TRef() { }
0048 
0049    TObject           *GetObject() const;
0050    TProcessID        *GetPID() const {return fPID;}
0051    Bool_t             IsValid() const {return GetUniqueID()!=0 ? kTRUE : kFALSE;}
0052    virtual void       SetAction(const char *name);
0053    virtual void       SetAction(TObject *parent);
0054 
0055    static void        SetObject(TObject *obj);
0056    static void        SetStaticObject(TObject *obj);
0057    static Int_t       AddExec(const char *name);
0058    static TObjArray  *GetListOfExecs();
0059    static TObject    *GetStaticObject();
0060 
0061    friend Bool_t operator==(const TRef &r1, const TRef &r2);
0062    friend Bool_t operator!=(const TRef &r1, const TRef &r2);
0063 
0064    ClassDefOverride(TRef,1)  //Persistent Reference link to a TObject
0065 };
0066 
0067 #endif