Warning, file /include/root/TBasket.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TBasket
0013 #define ROOT_TBasket
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 #include "TKey.h"
0029
0030 class TFile;
0031 class TTree;
0032 class TBranch;
0033
0034 class TBasket : public TKey {
0035 friend class TBranch;
0036
0037 private:
0038 TBasket(const TBasket&);
0039 TBasket& operator=(const TBasket&);
0040
0041
0042 Int_t ReadBasketBuffersUnzip(char*, Int_t, bool, TFile*);
0043 Int_t ReadBasketBuffersUncompressedCase();
0044
0045
0046 void InitializeCompressedBuffer(Int_t len, TFile* file);
0047
0048
0049 void ResetEntryOffset();
0050
0051
0052 Int_t *GetCalculatedEntryOffset();
0053
0054
0055 bool CanGenerateOffsetArray();
0056
0057
0058 void DisownBuffer();
0059 void AdoptBuffer(TBuffer *user_buffer);
0060
0061 protected:
0062 Int_t fBufferSize{0};
0063 Int_t fNevBufSize{0};
0064 Int_t fNevBuf{0};
0065 Int_t fLast{0};
0066 bool fHeaderOnly{false};
0067 UChar_t fIOBits{0};
0068 bool fOwnsCompressedBuffer{false};
0069 bool fReadEntryOffset{false};
0070 Int_t *fDisplacement{nullptr};
0071 Int_t *fEntryOffset{nullptr};
0072
0073 TBranch *fBranch{nullptr};
0074 TBuffer *fCompressedBufferRef{nullptr};
0075 Int_t fLastWriteBufferSize[3] = {0,0,0};
0076 bool fResetAllocation{false};
0077 UChar_t fNextBufferSizeRecord{0};
0078 #ifdef R__TRACK_BASKET_ALLOC_TIME
0079 ULong64_t fResetAllocationTime{0};
0080 #endif
0081
0082 virtual void ReadResetBuffer(Int_t basketnumber);
0083
0084 public:
0085
0086
0087
0088
0089
0090
0091
0092
0093
0094
0095
0096
0097 enum class EIOBits : Char_t {
0098
0099
0100 kGenerateOffsetMap = BIT(0),
0101
0102 kSupported = kGenerateOffsetMap
0103 };
0104
0105
0106
0107
0108
0109 enum class EUnsupportedIOBits : Char_t { kUnsupported = 0 };
0110
0111 static constexpr int kIOBitCount = 1;
0112
0113 TBasket();
0114 TBasket(TDirectory *motherDir);
0115 TBasket(const char *name, const char *title, TBranch *branch);
0116 ~TBasket() override;
0117
0118 virtual void AdjustSize(Int_t newsize);
0119 virtual void DeleteEntryOffset();
0120 virtual Int_t DropBuffers();
0121 TBranch *GetBranch() const {return fBranch;}
0122 Int_t GetBufferSize() const {return fBufferSize;}
0123 Int_t *GetDisplacement() const {return fDisplacement;}
0124 Int_t *GetEntryOffset()
0125 {
0126 return R__likely(fEntryOffset != reinterpret_cast<Int_t *>(-1)) ? fEntryOffset : GetCalculatedEntryOffset();
0127 }
0128 Int_t GetEntryPointer(Int_t Entry);
0129 Int_t GetNevBuf() const {return fNevBuf;}
0130 Int_t GetNevBufSize() const {return fNevBufSize;}
0131 Int_t GetLast() const {return fLast;}
0132 virtual void MoveEntries(Int_t dentries);
0133 virtual void PrepareBasket(Long64_t ) {};
0134 Int_t ReadBasketBuffers(Long64_t pos, Int_t len, TFile *file);
0135 Int_t ReadBasketBytes(Long64_t pos, TFile *file);
0136 virtual void WriteReset();
0137
0138
0139 #ifdef R__TRACK_BASKET_ALLOC_TIME
0140 ULong64_t GetResetAllocationTime() const { return fResetAllocationTime; }
0141 #endif
0142
0143 bool GetResetAllocationCount() const { return fResetAllocation; }
0144
0145 Int_t LoadBasketBuffers(Long64_t pos, Int_t len, TFile *file, TTree *tree = nullptr);
0146 Long64_t CopyTo(TFile *to);
0147
0148 void SetBranch(TBranch *branch) { fBranch = branch; }
0149 void SetNevBufSize(Int_t n) { fNevBufSize=n; }
0150 virtual void SetReadMode();
0151 virtual void SetWriteMode();
0152 inline void Update(Int_t newlast) { Update(newlast,newlast); };
0153 virtual void Update(Int_t newlast, Int_t skipped);
0154 virtual Int_t WriteBuffer();
0155
0156 ClassDefOverride(TBasket, 3);
0157 };
0158
0159 #endif