/usr/include/root/TFPBlock.h is in libroot-io-dev 5.34.19+dfsg-1.2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | // @(#)root/io:$Id$
// 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
Long64_t fDataSize; // total size of useful data in the block
Long64_t fCapacity; // capacity of the buffer
Int_t *fLen; // array of lengths of each segment
Long64_t *fPos; // array of positions of each segment
Long64_t *fRelOffset; // relative offset of piece in the buffer
TFPBlock(const TFPBlock&); // Not implemented.
TFPBlock &operator=(const TFPBlock&); // Not implemented.
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;
Long64_t GetDataSize() const;
Long64_t GetCapacity() const;
Int_t GetNoElem() const;
char *GetBuffer() const;
char *GetPtrToPiece(Int_t index) const;
void SetBuffer(char*);
void SetPos(Int_t, Long64_t);
void ReallocBlock(Long64_t*, Int_t*, Int_t);
ClassDef(TFPBlock, 0); // File prefetch block
};
//__________________________________________________________________
inline Long64_t* TFPBlock::GetPos() const
{
// Get pointer to the array of postions.
return fPos;
}
//__________________________________________________________________
inline Int_t* TFPBlock::GetLen() const
{
// Get pointer to the array of lengths.
return fLen;
}
//__________________________________________________________________
inline Long64_t TFPBlock::GetDataSize() const
{
// Return size of the data in the block.
return fDataSize;
}
//__________________________________________________________________
inline Long64_t TFPBlock::GetCapacity() const
{
// Return capacity of the block.
return fCapacity;
}
//__________________________________________________________________
inline Int_t TFPBlock::GetNoElem() const
{
// Return number of elements in the block.
return fNblock;
}
//__________________________________________________________________
inline Long64_t TFPBlock::GetPos(Int_t i) const
{
// Get position of the element at index i.
return fPos[i];
}
//__________________________________________________________________
inline Int_t TFPBlock::GetLen(Int_t i) const
{
// Get length of the element at index i.
return fLen[i];
}
//__________________________________________________________________
inline char* TFPBlock::GetBuffer() const
{
// Get block buffer.
return fBuffer;
}
//__________________________________________________________________
inline char* TFPBlock::GetPtrToPiece(Int_t index) const
{
// Get block buffer.
return (fBuffer + fRelOffset[index]);
}
#endif
|