TLeafObject.h

Go to the documentation of this file.
00001 // @(#)root/tree:$Id: TLeafObject.h 22991 2008-04-04 22:38:37Z pcanal $
00002 // Author: Rene Brun   27/01/96
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TLeafObject
00013 #define ROOT_TLeafObject
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TLeafObject                                                          //
00019 //                                                                      //
00020 // A TLeaf for a general object derived from TObject.                   //
00021 //                                                                      //
00022 //////////////////////////////////////////////////////////////////////////
00023 
00024 
00025 #ifndef ROOT_TLeaf
00026 #include "TLeaf.h"
00027 #endif
00028 #ifndef ROOT_TClassRef
00029 #include "TClassRef.h"
00030 #endif
00031 
00032 class TClass;
00033 class TMethodCall;
00034 
00035 class TLeafObject : public TLeaf {
00036 
00037 protected:
00038    TClassRef    fClass;          //! pointer to class
00039    void       **fObjAddress;     //! Address of Pointer to object
00040    Bool_t       fVirtual;        //  Support for polymorphism, when set classname is written with object.
00041     
00042 public:
00043    enum { kWarn = BIT(12) };
00044 
00045    TLeafObject();
00046    TLeafObject(TBranch *parent, const char *name, const char *type);
00047    virtual ~TLeafObject();
00048 
00049    virtual void    FillBasket(TBuffer &b);
00050    TClass         *GetClass() const {return fClass;}
00051    TMethodCall    *GetMethodCall(const char *name);
00052    TObject        *GetObject() const {return (TObject*)(*fObjAddress);}
00053    const char     *GetTypeName() const ;
00054    virtual void   *GetValuePointer() const {return fObjAddress;}
00055    Bool_t          IsOnTerminalBranch() const;
00056    Bool_t          IsVirtual() const {return fVirtual;}
00057    virtual Bool_t  Notify();
00058    virtual void    PrintValue(Int_t i=0) const;
00059    virtual void    ReadBasket(TBuffer &b);
00060    virtual void    SetAddress(void *add=0);
00061    virtual void    SetVirtual(Bool_t virt=kTRUE) {fVirtual=virt;}
00062     
00063    ClassDef(TLeafObject,4);  //A TLeaf for a general object derived from TObject.
00064 };
00065 
00066 #endif

Generated on Tue Jul 5 14:26:59 2011 for ROOT_528-00b_version by  doxygen 1.5.1