Logo ROOT  
Reference Guide
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Loading...
Searching...
No Matches
TGFALFile.h
Go to the documentation of this file.
1// @(#)root/gfal:$Id$
2// Author: Fons Rademakers 8/12/2005
3
4/*************************************************************************
5 * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_TGFALFile
13#define ROOT_TGFALFile
14
15#include "TFile.h"
16#include "TSystem.h"
17
18
19class TGFALFile : public TFile {
20
21private:
22 Bool_t fStatCached; ///<! (transient) is file status cached?
23 struct stat64 fStatBuffer; ///<! (transient) Cached file status buffer (for performance)
24
26
27 // Interface to basic system I/O routines
28 Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode) override;
29 Int_t SysClose(Int_t fd) override;
30 Int_t SysRead(Int_t fd, void *buf, Int_t len) override;
31 Int_t SysWrite(Int_t fd, const void *buf, Int_t len) override;
32 Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence) override;
33 Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime) override;
34 Int_t SysSync(Int_t) override { /* no fsync for GFAL */ return 0; }
35
36public:
37 TGFALFile(const char *url, Option_t *option="",
39 ~TGFALFile() override;
40
41 Bool_t ReadBuffer(char *buf, Int_t len) override;
42 Bool_t ReadBuffer(char *buf, Long64_t pos, Int_t len) override;
43 Bool_t WriteBuffer(const char *buf, Int_t len) override;
44
45 ClassDefOverride(TGFALFile,1) //A ROOT file that reads/writes via a GFAL
46};
47
48
49class TGFALSystem : public TSystem {
50
51private:
52 void *fDirp; // directory handler
53
54 void *GetDirPtr() const override { return fDirp; }
55
56public:
58 ~TGFALSystem() override { }
59
60 Int_t MakeDirectory(const char *name) override;
61 void *OpenDirectory(const char *name) override;
62 void FreeDirectory(void *dirp) override;
63 const char *GetDirEntry(void *dirp) override;
64 Int_t GetPathInfo(const char *path, FileStat_t &buf) override;
65 Bool_t AccessPathName(const char *path, EAccessMode mode) override;
66
67 ClassDefOverride(TGFALSystem,0) // Directory handler for GFAL
68};
69
70#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
bool Bool_t
Definition RtypesCore.h:63
int Int_t
Definition RtypesCore.h:45
long Long_t
Definition RtypesCore.h:54
unsigned int UInt_t
Definition RtypesCore.h:46
constexpr Bool_t kFALSE
Definition RtypesCore.h:101
long long Long64_t
Definition RtypesCore.h:80
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t option
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 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
Option_t Option_t TPoint TPoint const char mode
char name[80]
Definition TGX11.cxx:110
EAccessMode
Definition TSystem.h:43
A ROOT file is composed of a header, followed by consecutive data records (TKey instances) with a wel...
Definition TFile.h:53
Read and write data via the underlying Grid access mechanism.
Definition TGFALFile.h:19
Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence) override
Interface to system lseek.
Int_t SysClose(Int_t fd) override
Interface to system close. All arguments like in POSIX close.
Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode) override
Interface to system open. All arguments like in POSIX open.
Int_t SysSync(Int_t) override
Interface to system fsync. All arguments like in POSIX fsync().
Definition TGFALFile.h:34
Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime) override
Interface to TSystem:GetPathInfo().
Bool_t ReadBuffer(char *buf, Int_t len) override
Read specified byte range from remote file via GFAL.
struct stat64 fStatBuffer
! (transient) Cached file status buffer (for performance)
Definition TGFALFile.h:23
Int_t SysWrite(Int_t fd, const void *buf, Int_t len) override
Interface to system write. All arguments like in POSIX write.
~TGFALFile() override
GFAL file dtor. Close and flush directory structure.
Bool_t WriteBuffer(const char *buf, Int_t len) override
Write specified byte range to remote file via GFAL.
Int_t SysRead(Int_t fd, void *buf, Int_t len) override
Interface to system read. All arguments like in POSIX read.
Bool_t fStatCached
! (transient) is file status cached?
Definition TGFALFile.h:22
Directory handler for GFAL.
Definition TGFALFile.h:49
void * GetDirPtr() const override
Definition TGFALFile.h:54
Bool_t AccessPathName(const char *path, EAccessMode mode) override
Returns FALSE if one can access a file using the specified access mode.
void * OpenDirectory(const char *name) override
Open a directory via GFAL.
void FreeDirectory(void *dirp) override
Free directory via GFAL.
const char * GetDirEntry(void *dirp) override
Get directory entry via GFAL. Returns 0 in case no more entries.
~TGFALSystem() override
Definition TGFALFile.h:58
TGFALSystem()
Create helper class that allows directory access via GFAL.
void * fDirp
Definition TGFALFile.h:52
Int_t GetPathInfo(const char *path, FileStat_t &buf) override
Get info about a file.
Int_t MakeDirectory(const char *name) override
Make a directory via GFAL.
Abstract base class defining a generic interface to the underlying Operating System.
Definition TSystem.h:266
@ kUseCompiledDefault
Use the compile-time default setting.
Definition Compression.h:52