Logo ROOT   6.08/07
Reference Guide
TRFIOFile.h
Go to the documentation of this file.
1 // @(#)root/rfio:$Id$
2 // Author: Fons Rademakers 20/01/99 + Giulia Taurelli 29/06/2006
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, 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_TRFIOFile
13 #define ROOT_TRFIOFile
14 
15 #ifndef ROOT_TFile
16 #include "TFile.h"
17 #endif
18 #ifndef ROOT_TSystem
19 #include "TSystem.h"
20 #endif
21 
22 
23 class TRFIOFile : public TFile {
24 
25 private:
26  TRFIOFile() { }
27 
28  // Interface to basic system I/O routines
29  Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode);
30  Int_t SysClose(Int_t fd);
31  Int_t SysRead(Int_t fd, void *buf, Int_t len);
32  Int_t SysWrite(Int_t fd, const void *buf, Int_t len);
33  Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence);
34  Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
35  Int_t SysSync(Int_t) { /* no fsync for RFIO */ return 0; }
36  Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
37 
38 public:
39  TRFIOFile(const char *url, Option_t *option="",
40  const char *ftitle="", Int_t compress=1);
41  ~TRFIOFile();
42 
43  Int_t GetErrno() const;
44  void ResetErrno() const;
45 
46  ClassDef(TRFIOFile,1) //A ROOT file that reads/writes via a rfiod server
47 };
48 
49 /**
50 \class TRFIOSystem
51 \ingroup IO
52 
53 Directory handler for RFIO
54 */
55 
56 class TRFIOSystem : public TSystem {
57 
58 private:
59  void *fDirp; // directory handler
60 
61  void *GetDirPtr() const { return fDirp; }
62 
63 public:
64  TRFIOSystem();
65  virtual ~TRFIOSystem() { }
66 
67  Int_t MakeDirectory(const char *name);
68  void *OpenDirectory(const char *name);
69  void FreeDirectory(void *dirp);
70  const char *GetDirEntry(void *dirp);
71  Int_t GetPathInfo(const char *path, FileStat_t &buf);
72  Bool_t AccessPathName(const char *path, EAccessMode mode);
73  Int_t Unlink(const char *path);
74 
75  ClassDef(TRFIOSystem,0) // Directory handler for RFIO
76 };
77 
78 #endif
TRFIOFile()
Definition: TRFIOFile.h:26
long long Long64_t
Definition: RtypesCore.h:69
const char Option_t
Definition: RtypesCore.h:62
Int_t SysWrite(Int_t fd, const void *buf, Int_t len)
Interface to system write. All arguments like in POSIX write.
Definition: TRFIOFile.cxx:333
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
Definition: TFile.h:50
void ResetErrno() const
Method resetting the rfio_errno, serrno and errno.
Definition: TRFIOFile.cxx:405
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Int_t SysSync(Int_t)
Interface to system fsync. All arguments like in POSIX fsync().
Definition: TRFIOFile.h:35
~TRFIOFile()
RFIO file dtor. Close and flush directory structure.
Definition: TRFIOFile.cxx:197
#define ClassDef(name, id)
Definition: Rtypes.h:254
Int_t SysClose(Int_t fd)
Interface to system close. All arguments like in POSIX close.
Definition: TRFIOFile.cxx:311
Directory handler for RFIO.
Definition: TRFIOFile.h:56
A ROOT file that reads/writes via a rfiod server.
Definition: TRFIOFile.h:23
virtual ~TRFIOSystem()
Definition: TRFIOFile.h:65
unsigned int UInt_t
Definition: RtypesCore.h:42
long Long_t
Definition: RtypesCore.h:50
EAccessMode
Definition: TSystem.h:54
Int_t GetErrno() const
Method returning rfio_errno.
Definition: TRFIOFile.cxx:393
void * GetDirPtr() const
Definition: TRFIOFile.h:61
Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence)
Interface to system lseek.
Definition: TRFIOFile.cxx:346
Int_t SysRead(Int_t fd, void *buf, Int_t len)
Interface to system read. All arguments like in POSIX read.
Definition: TRFIOFile.cxx:322
Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode)
Interface to system open. All arguments like in POSIX open.
Definition: TRFIOFile.cxx:300
Abstract base class defining a generic interface to the underlying Operating System.
Definition: TSystem.h:258
Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime)
Interface to TSystem:GetPathInfo().
Definition: TRFIOFile.cxx:360
char name[80]
Definition: TGX11.cxx:109
Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf)
Read a list of buffers given in pos[] and len[] and return it in a single buffer. ...
Definition: TRFIOFile.cxx:206
void * fDirp
Definition: TRFIOFile.h:59