Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TLeafB.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   12/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_TLeafB
0013 #define ROOT_TLeafB
0014 
0015 
0016 //////////////////////////////////////////////////////////////////////////
0017 //                                                                      //
0018 // TLeafB                                                               //
0019 //                                                                      //
0020 // A TLeaf for an 8 bit Integer data type.                              //
0021 //                                                                      //
0022 //////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TLeaf.h"
0025 
0026 class TLeafB : public TLeaf {
0027 
0028 protected:
0029    Char_t       fMinimum;         ///<  Minimum value if leaf range is specified
0030    Char_t       fMaximum;         ///<  Maximum value if leaf range is specified
0031    Char_t       *fValue;          ///<! Pointer to data buffer
0032    Char_t       **fPointer;       ///<! Address of a pointer to data buffer!
0033 
0034 public:
0035    TLeafB();
0036    TLeafB(TBranch *parent, const char* name, const char* type);
0037    ~TLeafB() override;
0038 
0039    void            Export(TClonesArray* list, Int_t n) override;
0040    void            FillBasket(TBuffer& b) override;
0041    DeserializeType GetDeserializeType() const override { return DeserializeType::kZeroCopy; }
0042    Int_t           GetMaximum() const override { return fMaximum; }
0043    Int_t           GetMinimum() const override { return fMinimum; }
0044    const char     *GetTypeName() const override;
0045    Double_t        GetValue(Int_t i = 0) const override { return IsUnsigned() ? (Double_t)((UChar_t) fValue[i]) : (Double_t)fValue[i]; }
0046    void           *GetValuePointer() const override { return fValue; }
0047    bool            IncludeRange(TLeaf *) override;
0048    void            Import(TClonesArray* list, Int_t n) override;
0049    void            PrintValue(Int_t i = 0) const override;
0050    void            ReadBasket(TBuffer&) override;
0051    void            ReadBasketExport(TBuffer&, TClonesArray* list, Int_t n) override;
0052    void            ReadValue(std::istream &s, Char_t delim = ' ') override;
0053    void            SetAddress(void* addr = nullptr) override;
0054    virtual void    SetMaximum(Char_t max) { fMaximum = max; }
0055    virtual void    SetMinimum(Char_t min) { fMinimum = min; }
0056 
0057    // Deserialize N events from an input buffer.  Since chars are stored unchanged, there
0058    // is nothing to do here but return true if we don't have variable-length arrays.
0059    bool            ReadBasketFast(TBuffer&, Long64_t) override { return true; }
0060 
0061    ClassDefOverride(TLeafB,1);  //A TLeaf for an 8 bit Integer data type.
0062 };
0063 
0064 #endif