<commit_before>// @(#)root/tree:$Id$
// Author: <NAME>   19/01/96

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TBasket
#define ROOT_TBasket

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TBasket                                                              //
//                                                                      //
// The TBasket objects are created at run time to collect TTree entries //
// in buffers. When a Basket is full, it is written to the file.        //
// The Basket is kept in memory if there is enough space.               //
//  (see the fMaxVirtualsize of TTree).                                 //
//                                                                      //
// The Basket class derives from TKey.                                  //
//////////////////////////////////////////////////////////////////////////


#include "TKey.h"


class TFile;
class TTree;
class TBranch;

class TBasket : public TKey {

private:
   TBasket(const TBasket&);            ///< TBasket objects are not copiable.
   TBasket& operator=(const TBasket&); ///< TBasket objects are not copiable.

   // Internal corner cases for ReadBasketBuffers
   Int_t ReadBasketBuffersUnzip(char*, Int_t, Bool_t, TFile*);
   Int_t ReadBasketBuffersUncompressedCase();

   // Helper for managing the compressed buffer.
   void InitializeCompressedBuffer(Int_t len, TFile* file);

protected:
   Int_t       fBufferSize;      ///< fBuffer length in bytes
   Int_t       fNevBufSize;      ///< Length in Int_t of fEntryOffset OR fixed length of each entry if fEntryOffset is null!
   Int_t       fNevBuf;          ///< Number of entries in basket
   Int_t       fLast;            ///< Pointer to last used byte in basket
   Bool_t      fHeaderOnly;      ///< True when only the basket header must be read/written
   UChar_t     fIOBits{0};       ///<!IO feature flags.  Serialized in custom portion of streamer to avoid forward compat issues unless needed.
   Int_t      *fDisplacement;    ///<![fNevBuf] Displacement of entries in fBuffer(TKey)
   Int_t      *fEntryOffset;     ///<[fNevBuf] Offset of entries in fBuffer(TKey)
   TBranch    *fBranch;          ///<Pointer to the basket support branch
   TBuffer    *fCompressedBufferRef; ///<! Compressed buffer.
   Bool_t      fOwnsCompressedBuffer; ///<! Whether or not we own the compressed buffer.
   Int_t       fLastWriteBufferSize; ///<! Size of the buffer last time we wrote it to disk

public:
   // The IO bits flag is to provide improved forward-compatibility detection.
   // Any new non-forward compatibility flags related serialization should be
   // added here.  When a new flag is added, set it in the kSupported field;
   //
   // If (fIOBits & ~kSupported) is non-zero -- i.e., an unknown IO flag is set
   // in the fIOBits -- then the zombie flag will be set for this object.
   //
   enum class EIOBits: Char_t {
      // The following to bits are reserved for now; when supported, set
      // kSupported = kGenerateOffsetMap | kBasketClassMap
      // kGenerateOffsetMap = BIT(1),
      // kBasketClassMap = BIT(2),
      kSupported = 0
   };
   // This enum covers IOBits that are known to this ROOT release but
   // not supported; provides a mechanism for us to have experimental
   // changes that doing go into a supported release.
   //
   // (kUnsupported | kSupported) should result in the '|' of all IOBits.
   enum class EUnsupportedIOBits: Char_t { kUnsupported = 0 };
   // The number of known, defined IOBits.
   static constexpr int kIOBitCount = 0;

   TBasket();
   TBasket(TDirectory *motherDir);
   TBasket(const char *name, const char *title, TBranch *branch);
   virtual ~TBasket();

   virtual void    AdjustSize(Int_t newsize);
   virtual void    DeleteEntryOffset();
   virtual Int_t   DropBuffers();
   TBranch        *GetBranch() const {return fBranch;}
           Int_t   GetBufferSize() const {return fBufferSize;}
           Int_t  *GetDisplacement() const {return fDisplacement;}
           Int_t  *GetEntryOffset() const {return fEntryOffset;}
           Int_t   GetEntryPointer(Int_t Entry);
           Int_t   GetNevBuf() const {return fNevBuf;}<commit_msg>Update doc wording.<commit_after>// @(#)root/tree:$Id$
// Author: <NAME>   19/01/96

/*************************************************************************
 * Copyright (C) 1995-2000, <NAME> and <NAME>.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TBasket
#define ROOT_TBasket

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TBasket                                                              //
//                                                                      //
// The TBasket objects are created at run time to collect TTree entries //
// in buffers. When a Basket is full, it is written to the file.        //
// The Basket is kept in memory if there is enough space.               //
//  (see the fMaxVirtualsize of TTree).                                 //
//                                                                      //
// The Basket class derives from TKey.                                  //
//////////////////////////////////////////////////////////////////////////


#include "TKey.h"


class TFile;
class TTree;
class TBranch;

class TBasket : public TKey {

private:
   TBasket(const TBasket&);            ///< TBasket objects are not copiable.
   TBasket& operator=(const TBasket&); ///< TBasket objects are not copiable.

   // Internal corner cases for ReadBasketBuffers
   Int_t ReadBasketBuffersUnzip(char*, Int_t, Bool_t, TFile*);
   Int_t ReadBasketBuffersUncompressedCase();

   // Helper for managing the compressed buffer.
   void InitializeCompressedBuffer(Int_t len, TFile* file);

protected:
   Int_t       fBufferSize;      ///< fBuffer length in bytes
   Int_t       fNevBufSize;      ///< Length in Int_t of fEntryOffset OR fixed length of each entry if fEntryOffset is null!
   Int_t       fNevBuf;          ///< Number of entries in basket
   Int_t       fLast;            ///< Pointer to last used byte in basket
   Bool_t      fHeaderOnly;      ///< True when only the basket header must be read/written
   UChar_t     fIOBits{0};       ///<!IO feature flags.  Serialized in custom portion of streamer to avoid forward compat issues unless needed.
   Int_t      *fDisplacement;    ///<![fNevBuf] Displacement of entries in fBuffer(TKey)
   Int_t      *fEntryOffset;     ///<[fNevBuf] Offset of entries in fBuffer(TKey)
   TBranch    *fBranch;          ///<Pointer to the basket support branch
   TBuffer    *fCompressedBufferRef; ///<! Compressed buffer.
   Bool_t      fOwnsCompressedBuffer; ///<! Whether or not we own the compressed buffer.
   Int_t       fLastWriteBufferSize; ///<! Size of the buffer last time we wrote it to disk

public:
   // The IO bits flag is to provide improved forward-compatibility detection.
   // Any new non-forward compatibility flags related serialization should be
   // added here.  When a new flag is added, set it in the kSupported field;
   //
   // If (fIOBits & ~kSupported) is non-zero -- i.e., an unknown IO flag is set
   // in the fIOBits -- then the zombie flag will be set for this object.
   //
   enum class EIOBits: Char_t {
      // The following to bits are reserved for now; when supported, set
      // kSupported = kGenerateOffsetMap | kBasketClassMap
      // kGenerateOffsetMap = BIT(1),
      // kBasketClassMap = BIT(2),
      kSupported = 0
   };
   // This enum covers IOBits that are known to this ROOT release but
   // not supported; provides a mechanism for us to have experimental
   // changes that are not going go into a supported release.
   //
   // (kUnsupported | kSupported) should result in the '|' of all IOBits.
   enum class EUnsupportedIOBits: Char_t { kUnsupported = 0 };
   // The number of known, defined IOBits.
   static constexpr int kIOBitCount = 0;

   TBasket();
   TBasket(TDirectory *motherDir);
   TBasket(const char *name, const char *title, TBranch *branch);
   virtual ~TBasket();

   virtual void    AdjustSize(Int_t newsize);
   virtual void    DeleteEntryOffset();
   virtual Int_t   DropBuffers();
   TBranch        *GetBranch() const {return fBranch;}
           Int_t   GetBufferSize() const {return fBufferSize;}
           Int_t  *GetDisplacement() const {return fDisplacement;}
           Int_t  *GetEntryOffset() const {return fEntryOffset;}
           Int_t   GetEntryPointer(Int_t Entry);
           Int_t   GetNevBuf() const {return fNevBuf;}
{'fraction_non_alphanumeric': 0.14143426294820718, 'fraction_numerical': 0.004193751310547285, 'mean_word_length': 1.7269868496283591, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 34, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7452145', 'n_tokens_mistral': 2486, 'n_tokens_neox': 2386, 'n_words': 883}