Back to home page

EIC code displayed by LXR

 
 

    


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