31inline int xtod(
char c) {
return (
c>=
'0' &&
c<=
'9') ?
c-
'0' : ((
c>=
'A' &&
c<=
'F') ?
c-
'A'+10 : ((
c>=
'a' &&
c<=
'f') ?
c-
'a'+10 : 0)); }
116 if (
fFile->GetArchive()) {
146 Int_t first = 0, last = -1, mid = -1;
149 while (first <= last){
150 mid = first + (last - first) / 2;
206 memcpy(buf, pBuff,
len);
341 assert((
fFile == file) &&
"kDoNotDisconnect must reattach to the same file");
384 const char* ptr = hex;
405 if (!
gSystem->OpenDirectory(fullPath))
424 fullPath +=
"/" + dirName +
"/" + fileName;
427 if (
gSystem->GetPathInfo(fullPath, stat) == 0) {
428 path =
new char[fullPath.
Length() + 1];
429 strlcpy(path, fullPath,fullPath.
Length() + 1);
446 strPath +=
"?filetype=raw";
457 fFile->SetReadCalls(
fFile->GetReadCalls() + 1);
458 fFile->fgReadCalls++;
496 fullPath += (
"/" + dirName);
498 if (!
gSystem->OpenDirectory(fullPath))
502 fullPath += (
"/" + fileName);
504 if (
gSystem->GetPathInfo(fullPath, stat) == 0) {
505 fullPath +=
"?filetype=raw";
508 fullPath +=
"?filetype=raw";
530 if (!
gSystem->OpenDirectory(path)){
531 return (!
gSystem->mkdir(path) ?
true :
false);
static const int kMAX_READ_SIZE
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h length
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t UChar_t len
R__EXTERN TSystem * gSystem
R__EXTERN TVirtualMonitoringWriter * gMonitoringWriter
This class represents the encapsulation of a block request.
char * GetPtrToPiece(Int_t index) const
Get block buffer.
void SetPos(Int_t, Long64_t)
Set pos value for index idx.
void SetBuffer(char *)
Set block buffer.
Long64_t GetDataSize() const
Return size of the data in the block.
void ReallocBlock(Long64_t *, Int_t *, Int_t)
Reallocate the block's buffer based on the length of the elements it will contain.
Int_t GetLen(Int_t) const
Get length of the element at index i.
Int_t GetNoElem() const
Return number of elements in the block.
Long64_t GetPos(Int_t) const
Get position of the element at index i.
char * GetBuffer() const
Get block buffer.
The prefetching mechanism uses two classes (TFilePrefetch and TFPBlock) to prefetch in advance a bloc...
Bool_t BinarySearchReadList(TFPBlock *, Long64_t, Int_t, Int_t *)
Search for a requested element in a block and return the index.
void ReadBlock(Long64_t *, Int_t *, Int_t)
Create a TFPBlock object or recycle one and add it to the prefetchBlocks list.
static TThread::VoidRtnFunc_t ThreadProc(void *)
Execution loop of the consumer thread.
Int_t SumHex(const char *)
Sum up individual hex values to obtain a decimal value.
TFilePrefetch(TFile *)
Constructor.
TSemaphore * fSemChangeFile
semaphore used when changing a file in TChain
void ReadListOfBlocks()
Get blocks specified in prefetchBlocks.
TFPBlock * CreateBlockObj(Long64_t *, Int_t *, Int_t)
Create a new block or recycle an old one.
TThread * fConsumer
consumer thread
std::condition_variable fNewBlockAdded
signal the addition of a new pending block
void AddReadBlock(TFPBlock *)
Safe method to add a block to the readList.
Bool_t CheckBlockInCache(char *&, TFPBlock *)
Test if the block is in cache.
Long64_t GetWaitTime()
Return the time spent wating for buffer to be read in microseconds.
Bool_t fThreadJoined
mark if async thread was joined
Bool_t SetCache(const char *)
Set the path of the cache directory.
TList * fReadBlocks
list of blocks read
Int_t ThreadStart()
Used to start the consumer thread.
std::atomic< Bool_t > fPrefetchFinished
true if prefetching is over
void ReadAsync(TFPBlock *, Bool_t &)
Read one block and insert it in prefetchBuffers list.
TFPBlock * GetPendingBlock()
Safe method to remove a block from the pendingList.
void AddPendingBlock(TFPBlock *)
Safe method to add a block to the pendingList.
Bool_t ReadBuffer(char *, Long64_t, Int_t)
Return a prefetched element.
TString fPathCache
path to the cache directory
std::mutex fMutexReadList
mutex for the list of read blocks
TStopwatch fWaitTime
time waiting to prefetch a buffer (in usec)
std::mutex fMutexPendingList
mutex for the pending list
std::condition_variable fReadBlockAdded
signal the addition of a new red block
void WaitFinishPrefetch()
Killing the async prefetching thread.
TThread * GetThread() const
Return reference to the consumer thread.
TFile * fFile
reference to the file
TList * fPendingBlocks
list of pending blocks to be read
void SetFile(TFile *file, TFile::ECacheAction action=TFile::kDisconnect)
Change the file.
char * GetBlockFromCache(const char *, Int_t)
Return a buffer from cache.
void SaveBlockInCache(TFPBlock *)
Save the block content in cache.
~TFilePrefetch() override
Destructor.
Bool_t IsPrefetchFinished() const
A file, usually with extension .root, that stores data and code in the form of serialized objects in ...
virtual Bool_t WriteBuffer(const char *buf, Int_t len)
Write a buffer to the file.
ECacheAction
TTreeCache flushing semantics.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
void Close(Option_t *option="") override
Close a file.
virtual Bool_t ReadBuffer(char *buf, Int_t len)
Read a buffer from the file.
This code implements the MD5 message-digest algorithm.
const char * AsString() const
Return message digest as string.
void Update(const UChar_t *buf, UInt_t len)
Update TMD5 object to reflect the concatenation of another buffer full of bytes.
void Final()
MD5 finalization, ends an MD5 message-digest operation, writing the the message digest and zeroizing ...
const char * Data() const
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
<div class="legacybox"><h2>Legacy Code</h2> TThread is a legacy interface: there will be no bug fixes...
void *(* VoidRtnFunc_t)(void *)
The TTimeStamp encapsulates seconds and ns since EPOCH.