ROOT logo
// @(#)root/io:$Id: TFPBlock.h 41698 2011-11-01 21:22:54Z pcanal $
// Author: Elvin Sindrilaru   19/05/2011

/*************************************************************************
 * Copyright (C) 1995-2011, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TFPBlock
#define ROOT_TFPBlock

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TFPBlock                                                             //
//                                                                      //
// This class represents the encapsulation of a block request.          //
// It contains the chunks to be prefetched and also serves as a         //
// container for the information read.                                  //
// These blocks are prefetch in a special reader thread by the          //
// TFilePrefetch class.                                                 //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TObject
#include "TObject.h"
#endif

class TFPBlock : public TObject{

private:
   char     *fBuffer;       // content of the block
   Int_t     fNblock;       // number of segment in the block
   Int_t     fFullSize;     // total size of segments that make up the block
   Int_t    *fLen;          // array of lengths of each segment
   Long64_t *fPos;          // array of positions of each segment

public:
   TFPBlock(Long64_t*, Int_t*, Int_t);
   virtual ~TFPBlock();

   Long64_t  GetPos(Int_t) const;
   Int_t     GetLen(Int_t) const;

   Long64_t *GetPos() const;
   Int_t    *GetLen() const;
   Int_t     GetFullSize() const;
   Int_t     GetNoElem() const;
   char     *GetBuffer() const;

   void SetBuffer(char*);
   void SetPos(Int_t, Long64_t);
   void ReallocBlock(Long64_t*, Int_t*, Int_t);

   ClassDef(TFPBlock, 0);  // File prefetch block
};

#endif
 TFPBlock.h:1
 TFPBlock.h:2
 TFPBlock.h:3
 TFPBlock.h:4
 TFPBlock.h:5
 TFPBlock.h:6
 TFPBlock.h:7
 TFPBlock.h:8
 TFPBlock.h:9
 TFPBlock.h:10
 TFPBlock.h:11
 TFPBlock.h:12
 TFPBlock.h:13
 TFPBlock.h:14
 TFPBlock.h:15
 TFPBlock.h:16
 TFPBlock.h:17
 TFPBlock.h:18
 TFPBlock.h:19
 TFPBlock.h:20
 TFPBlock.h:21
 TFPBlock.h:22
 TFPBlock.h:23
 TFPBlock.h:24
 TFPBlock.h:25
 TFPBlock.h:26
 TFPBlock.h:27
 TFPBlock.h:28
 TFPBlock.h:29
 TFPBlock.h:30
 TFPBlock.h:31
 TFPBlock.h:32
 TFPBlock.h:33
 TFPBlock.h:34
 TFPBlock.h:35
 TFPBlock.h:36
 TFPBlock.h:37
 TFPBlock.h:38
 TFPBlock.h:39
 TFPBlock.h:40
 TFPBlock.h:41
 TFPBlock.h:42
 TFPBlock.h:43
 TFPBlock.h:44
 TFPBlock.h:45
 TFPBlock.h:46
 TFPBlock.h:47
 TFPBlock.h:48
 TFPBlock.h:49
 TFPBlock.h:50
 TFPBlock.h:51
 TFPBlock.h:52
 TFPBlock.h:53
 TFPBlock.h:54
 TFPBlock.h:55
 TFPBlock.h:56
 TFPBlock.h:57
 TFPBlock.h:58
 TFPBlock.h:59
 TFPBlock.h:60