ROOT logo
// @(#)root/tree:$Id: TLeafObject.h 22991 2008-04-04 22:38:37Z pcanal $
// Author: Rene Brun   27/01/96

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TLeafObject
#define ROOT_TLeafObject


//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TLeafObject                                                          //
//                                                                      //
// A TLeaf for a general object derived from TObject.                   //
//                                                                      //
//////////////////////////////////////////////////////////////////////////


#ifndef ROOT_TLeaf
#include "TLeaf.h"
#endif
#ifndef ROOT_TClassRef
#include "TClassRef.h"
#endif

class TClass;
class TMethodCall;

class TLeafObject : public TLeaf {

protected:
   TClassRef    fClass;          //! pointer to class
   void       **fObjAddress;     //! Address of Pointer to object
   Bool_t       fVirtual;        //  Support for polymorphism, when set classname is written with object.
    
public:
   enum { kWarn = BIT(12) };

   TLeafObject();
   TLeafObject(TBranch *parent, const char *name, const char *type);
   virtual ~TLeafObject();

   virtual void    FillBasket(TBuffer &b);
   TClass         *GetClass() const {return fClass;}
   TMethodCall    *GetMethodCall(const char *name);
   TObject        *GetObject() const {return (TObject*)(*fObjAddress);}
   const char     *GetTypeName() const ;
   virtual void   *GetValuePointer() const {return fObjAddress;}
   Bool_t          IsOnTerminalBranch() const;
   Bool_t          IsVirtual() const {return fVirtual;}
   virtual Bool_t  Notify();
   virtual void    PrintValue(Int_t i=0) const;
   virtual void    ReadBasket(TBuffer &b);
   virtual void    SetAddress(void *add=0);
   virtual void    SetVirtual(Bool_t virt=kTRUE) {fVirtual=virt;}
    
   ClassDef(TLeafObject,4);  //A TLeaf for a general object derived from TObject.
};

#endif
 TLeafObject.h:1
 TLeafObject.h:2
 TLeafObject.h:3
 TLeafObject.h:4
 TLeafObject.h:5
 TLeafObject.h:6
 TLeafObject.h:7
 TLeafObject.h:8
 TLeafObject.h:9
 TLeafObject.h:10
 TLeafObject.h:11
 TLeafObject.h:12
 TLeafObject.h:13
 TLeafObject.h:14
 TLeafObject.h:15
 TLeafObject.h:16
 TLeafObject.h:17
 TLeafObject.h:18
 TLeafObject.h:19
 TLeafObject.h:20
 TLeafObject.h:21
 TLeafObject.h:22
 TLeafObject.h:23
 TLeafObject.h:24
 TLeafObject.h:25
 TLeafObject.h:26
 TLeafObject.h:27
 TLeafObject.h:28
 TLeafObject.h:29
 TLeafObject.h:30
 TLeafObject.h:31
 TLeafObject.h:32
 TLeafObject.h:33
 TLeafObject.h:34
 TLeafObject.h:35
 TLeafObject.h:36
 TLeafObject.h:37
 TLeafObject.h:38
 TLeafObject.h:39
 TLeafObject.h:40
 TLeafObject.h:41
 TLeafObject.h:42
 TLeafObject.h:43
 TLeafObject.h:44
 TLeafObject.h:45
 TLeafObject.h:46
 TLeafObject.h:47
 TLeafObject.h:48
 TLeafObject.h:49
 TLeafObject.h:50
 TLeafObject.h:51
 TLeafObject.h:52
 TLeafObject.h:53
 TLeafObject.h:54
 TLeafObject.h:55
 TLeafObject.h:56
 TLeafObject.h:57
 TLeafObject.h:58
 TLeafObject.h:59
 TLeafObject.h:60
 TLeafObject.h:61
 TLeafObject.h:62
 TLeafObject.h:63
 TLeafObject.h:64
 TLeafObject.h:65
 TLeafObject.h:66