Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // @(#)root/tree:$Id$
0002 // Author: Rene Brun   27/01/96
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_TLeafObject
0013 #define ROOT_TLeafObject
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TLeafObject                                                          //
0019 //                                                                      //
0020 // A TLeaf for a general object derived from TObject.                   //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 
0025 #include "TLeaf.h"
0026 #include "TClassRef.h"
0027 
0028 class TClass;
0029 class TMethodCall;
0030 
0031 class TLeafObject : public TLeaf {
0032 
0033 protected:
0034    TClassRef    fClass;          ///<! pointer to class
0035    void       **fObjAddress;     ///<! Address of Pointer to object
0036    bool         fVirtual;        ///<  Support for polymorphism, when set classname is written with object.
0037 
0038 public:
0039    enum EStatusBits {
0040       kWarn = BIT(14)
0041    };
0042 
0043    /// In version of ROOT older then v6.12, kWarn was set to BIT(12)
0044    /// which overlaps with TBranch::kBranchObject.  Since it stored
0045    /// in ROOT files as part of the TBranchObject and that we want
0046    /// to reset in TBranchObject::Streamer, we need to keep track
0047    /// of the old value.
0048    enum EStatusBitsOldValues {
0049       kOldWarn = BIT(12)
0050    };
0051 
0052    TLeafObject();
0053    TLeafObject(TBranch *parent, const char *name, const char *type);
0054    ~TLeafObject() override;
0055 
0056    bool            CanGenerateOffsetArray() override { return false; }
0057    void            FillBasket(TBuffer &b) override;
0058    virtual Int_t  *GenerateOffsetArrayBase(Int_t /*base*/, Int_t /*events*/) { return nullptr; }
0059    TClass         *GetClass() const {return fClass;}
0060    TMethodCall    *GetMethodCall(const char *name);
0061    TObject        *GetObject() const {return (TObject*)(*fObjAddress);}
0062    const char     *GetTypeName() const override;
0063    void           *GetValuePointer() const override {return fObjAddress;}
0064    bool            IsOnTerminalBranch() const override;
0065    bool            IsVirtual() const {return fVirtual;}
0066    bool            Notify() override;
0067    void            PrintValue(Int_t i=0) const override;
0068    void            ReadBasket(TBuffer &b) override;
0069    void            SetAddress(void *add=nullptr) override;
0070    virtual void    SetVirtual(bool virt=true) {fVirtual=virt;}
0071 
0072    ClassDefOverride(TLeafObject,4);  //A TLeaf for a general object derived from TObject.
0073 };
0074 
0075 #endif