Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TLeafD32.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: Simon Spies 23/02/19
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2019, 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_TLeafD32
0013 #define ROOT_TLeafD32
0014 
0015 //////////////////////////////////////////////////////////////////////////
0016 //                                                                      //
0017 // TLeafD32                                                             //
0018 //                                                                      //
0019 // A TLeaf for a 24 bit truncated floating point data type.             //
0020 //                                                                      //
0021 //////////////////////////////////////////////////////////////////////////
0022 
0023 #include "TLeaf.h"
0024 
0025 class TStreamerElement;
0026 
0027 
0028 class TLeafD32 : public TLeaf {
0029 
0030 protected:
0031    Double32_t fMinimum;        ///<  Minimum value if leaf range is specified
0032    Double32_t fMaximum;        ///<  Maximum value if leaf range is specified
0033    Double32_t *fValue;         ///<! Pointer to data buffer
0034    Double32_t **fPointer;      ///<! Address of pointer to data buffer
0035    TStreamerElement *fElement; ///<! StreamerElement used for TBuffer read / write
0036 
0037 public:
0038    TLeafD32();
0039    TLeafD32(TBranch *parent, const char *name, const char *type);
0040    ~TLeafD32() override;
0041 
0042    DeserializeType GetDeserializeType() const override { return DeserializeType::kExternal; }
0043    void            Export(TClonesArray *list, Int_t n) override;
0044    void            FillBasket(TBuffer &b) override;
0045    const char     *GetTypeName() const override { return "Double32_t"; }
0046    Double_t        GetValue(Int_t i = 0) const override;
0047    void           *GetValuePointer() const override { return fValue; }
0048    void            Import(TClonesArray *list, Int_t n) override;
0049    void            PrintValue(Int_t i = 0) const override;
0050    void            ReadBasket(TBuffer &b) override;
0051    void            ReadBasketExport(TBuffer &b, TClonesArray *list, Int_t n) override;
0052    void            ReadValue(std::istream &s, Char_t delim = ' ') override;
0053    void            SetAddress(void *add = nullptr) override;
0054 
0055    ClassDefOverride(TLeafD32, 1); // A TLeaf for a 24 bit truncated floating point data type.
0056 };
0057 
0058 // if leaf is a simple type, i must be set to 0
0059 // if leaf is an array, i is the array element number to be returned
0060 inline Double_t TLeafD32::GetValue(Int_t i) const
0061 {
0062    return fValue[i];
0063 }
0064 
0065 #endif