Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TLeafB.h
Go to the documentation of this file.
1 // @(#)root/tree:$Id$
2 // Author: Rene Brun 12/01/96
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TLeafB
13 #define ROOT_TLeafB
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TLeafB //
19 // //
20 // A TLeaf for an 8 bit Integer data type. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #include "TLeaf.h"
25 
26 class TLeafB : public TLeaf {
27 
28 protected:
29  Char_t fMinimum; ///< Minimum value if leaf range is specified
30  Char_t fMaximum; ///< Maximum value if leaf range is specified
31  Char_t *fValue; ///<! Pointer to data buffer
32  Char_t **fPointer; ///<! Address of a pointer to data buffer!
33 
34 public:
35  TLeafB();
36  TLeafB(TBranch *parent, const char* name, const char* type);
37  virtual ~TLeafB();
38 
39  virtual void Export(TClonesArray* list, Int_t n);
40  virtual void FillBasket(TBuffer& b);
41  virtual DeserializeType GetDeserializeType() const { return fLeafCount ? DeserializeType::kDestructive : DeserializeType::kZeroCopy; }
42  virtual Int_t GetMaximum() const { return fMaximum; }
43  virtual Int_t GetMinimum() const { return fMinimum; }
44  const char *GetTypeName() const;
45  Double_t GetValue(Int_t i = 0) const { return IsUnsigned() ? (Double_t)((UChar_t) fValue[i]) : (Double_t)fValue[i]; }
46  virtual void *GetValuePointer() const { return fValue; }
47  virtual Bool_t IncludeRange(TLeaf *);
48  virtual void Import(TClonesArray* list, Int_t n);
49  virtual void PrintValue(Int_t i = 0) const;
50  virtual void ReadBasket(TBuffer&);
51  virtual void ReadBasketExport(TBuffer&, TClonesArray* list, Int_t n);
52  virtual void ReadValue(std::istream &s, Char_t delim = ' ');
53  virtual void SetAddress(void* addr = 0);
54  virtual void SetMaximum(Char_t max) { fMaximum = max; }
55  virtual void SetMinimum(Char_t min) { fMinimum = min; }
56 
57  // Deserialize N events from an input buffer. Since chars are stored unchanged, there
58  // is nothing to do here but return true if we don't have variable-length arrays.
59  virtual bool ReadBasketFast(TBuffer&, Long64_t) { return !fLeafCount; }
60  virtual bool ReadBasketSerialized(TBuffer&, Long64_t) { return !fLeafCount; }
61 
62  ClassDef(TLeafB,1); //A TLeaf for an 8 bit Integer data type.
63 };
64 
65 #endif