Logo ROOT   6.10/09
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 #include "TFile.h"
16 #include "TSystem.h"
17 
18 
19 class TRFIOFile : public TFile {
20 
21 private:
22  TRFIOFile() { }
23 
24  // Interface to basic system I/O routines
25  Int_t SysOpen(const char *pathname, Int_t flags, UInt_t mode);
26  Int_t SysClose(Int_t fd);
27  Int_t SysRead(Int_t fd, void *buf, Int_t len);
28  Int_t SysWrite(Int_t fd, const void *buf, Int_t len);
29  Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence);
30  Int_t SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
31  Int_t SysSync(Int_t) { /* no fsync for RFIO */ return 0; }
32  Bool_t ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbuf);
33 
34 public:
35  TRFIOFile(const char *url, Option_t *option="",
36  const char *ftitle="", Int_t compress=1);
37  ~TRFIOFile();
38 
39  Int_t GetErrno() const;
40  void ResetErrno() const;
41 
42  ClassDef(TRFIOFile,1) //A ROOT file that reads/writes via a rfiod server
43 };
44 
45 /**
46 \class TRFIOSystem
47 \ingroup IO
48 
49 Directory handler for RFIO
50 */
51 
52 class TRFIOSystem : public TSystem {
53 
54 private:
55  void *fDirp; // directory handler
56 
57  void *GetDirPtr() const { return fDirp; }
58 
59 public:
60  TRFIOSystem();
61  virtual ~TRFIOSystem() { }
62 
63  Int_t MakeDirectory(const char *name);
64  void *OpenDirectory(const char *name);
65  void FreeDirectory(void *dirp);
66  const char *GetDirEntry(void *dirp);
67  Int_t GetPathInfo(const char *path, FileStat_t &buf);
68  Bool_t AccessPathName(const char *path, EAccessMode mode);
69  Int_t Unlink(const char *path);
70 
71  ClassDef(TRFIOSystem,0) // Directory handler for RFIO
72 };
73 
74 #endif
TRFIOFile()
Definition: TRFIOFile.h:22
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:46
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:31
~TRFIOFile()
RFIO file dtor. Close and flush directory structure.
Definition: TRFIOFile.cxx:197
#define ClassDef(name, id)
Definition: Rtypes.h:297
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:52
A ROOT file that reads/writes via a rfiod server.
Definition: TRFIOFile.h:19
virtual ~TRFIOSystem()
Definition: TRFIOFile.h:61
unsigned int UInt_t
Definition: RtypesCore.h:42
long Long_t
Definition: RtypesCore.h:50
EAccessMode
Definition: TSystem.h:44
Int_t GetErrno() const
Method returning rfio_errno.
Definition: TRFIOFile.cxx:393
void * GetDirPtr() const
Definition: TRFIOFile.h:57
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:248
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
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:55