TChirpFile.h

Go to the documentation of this file.
00001 // @(#)root/chirp:$Id: TChirpFile.h 34444 2010-07-16 02:17:39Z pcanal $
00002 // Author: Dan Bradley   17/12/2002
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2002, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 
00012 #ifndef ROOT_TChirpFile
00013 #define ROOT_TChirpFile
00014 
00015 
00016 //////////////////////////////////////////////////////////////////////////
00017 //                                                                      //
00018 // TChirpFile                                                           //
00019 //                                                                      //
00020 // A TChirpFile is like a normal TFile except that it reads and writes  //
00021 // its data via a Chirp server.  For more information, see              //
00022 // http://www.cs.wisc.edu/condor/chirp.                                 //
00023 //                                                                      //
00024 //////////////////////////////////////////////////////////////////////////
00025 
00026 
00027 #ifndef ROOT_TFile
00028 #include "TFile.h"
00029 #endif
00030 
00031 class TChirpFile : public TFile {
00032 
00033 private:
00034    struct chirp_client *chirp_client;
00035 
00036    TChirpFile() : chirp_client(0) { }
00037 
00038    // Interface to basic system I/O routines
00039    Int_t    SysOpen(const char *pathname, Int_t flags, UInt_t mode);
00040    Int_t    SysClose(Int_t fd);
00041    Int_t    SysRead(Int_t fd, void *buf, Int_t len);
00042    Int_t    SysWrite(Int_t fd, const void *buf, Int_t len);
00043    Long64_t SysSeek(Int_t fd, Long64_t offset, Int_t whence);
00044    Int_t    SysStat(Int_t fd, Long_t *id, Long64_t *size, Long_t *flags, Long_t *modtime);
00045    Int_t    SysSync(Int_t fd);
00046 
00047    Int_t OpenChirpClient(const char *URL,char const **path);
00048    Int_t CloseChirpClient();
00049 
00050 public:
00051    TChirpFile(const char *path, Option_t *option="",
00052               const char *ftitle="", Int_t compress=1);
00053 
00054    ~TChirpFile();
00055 
00056    Bool_t  ReadBuffer(char *buf, Int_t len);
00057    Bool_t  ReadBuffer(char *buf, Long64_t pos, Int_t len);
00058    Bool_t  WriteBuffer(const char *buf, Int_t len);
00059 
00060    void    ResetErrno() const;
00061 
00062    ClassDef(TChirpFile,0)  //A ROOT file that reads/writes via a Chirp server
00063 };
00064 
00065 #endif

Generated on Tue Jul 5 14:28:34 2011 for ROOT_528-00b_version by  doxygen 1.5.1