Logo ROOT   6.08/07
Reference Guide
TCastorFile.h
Go to the documentation of this file.
1 // @(#)root/castor:$Id$
2 // Author: Fons Rademakers 17/09/2003 + Giulia Taurelli 29/06/2006
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, 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_TCastorFile
13 #define ROOT_TCastorFile
14 
15 #ifndef ROOT_TNetFile
16 #include "TNetFile.h"
17 #endif
18 
19 
20 class TCastorFile : public TNetFile {
21 
22 private:
23  TString fDiskServer; ///< CASTOR remote disk server
24  TString fInternalPath; ///< CASTOR internal path
25  Bool_t fIsCastor; ///< true if internal path is valid
26  Bool_t fWrittenTo; ///< true if data has been written to file
27 
28  TString fAuthProto; ///< Used to specific the auth protocol
29 
30  void FindServerAndPath();
31  void ConnectServer(Int_t *stat, EMessageTypes *kind, Int_t netopt,
32  Int_t tcpwindowsize, Bool_t forceOpen,
33  Bool_t forceRead);
34  Int_t SysClose(Int_t fd);
35 
36 public:
37  TCastorFile(const char *url, Option_t *option = "", const char *ftitle = "",
38  Int_t compress = 1, Int_t netopt = 0);
39  TCastorFile() : TNetFile() { fIsCastor = fWrittenTo = kFALSE; }
40  virtual ~TCastorFile() { }
41 
42  Bool_t WriteBuffer(const char *buf, Int_t len);
43 
44  ClassDef(TCastorFile,1) //TFile reading/writing via rootd to a CASTOR server
45 };
46 
47 #endif
Bool_t WriteBuffer(const char *buf, Int_t len)
Write specified byte range to remote file via rootd daemon.
const char Option_t
Definition: RtypesCore.h:62
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
Bool_t fIsCastor
true if internal path is valid
Definition: TCastorFile.h:25
Int_t SysClose(Int_t fd)
Close currently open file.
void ConnectServer(Int_t *stat, EMessageTypes *kind, Int_t netopt, Int_t tcpwindowsize, Bool_t forceOpen, Bool_t forceRead)
Connect to remote rootd server on CASTOR disk server.
#define ClassDef(name, id)
Definition: Rtypes.h:254
void FindServerAndPath()
Find the CASTOR disk server and internal file path.
A TNetFile interfaced to the Castor storage backend.
Definition: TCastorFile.h:20
Bool_t fWrittenTo
true if data has been written to file
Definition: TCastorFile.h:26
TString fAuthProto
Used to specific the auth protocol.
Definition: TCastorFile.h:28
EMessageTypes
Definition: MessageTypes.h:27
TString fDiskServer
CASTOR remote disk server.
Definition: TCastorFile.h:23
TString fInternalPath
CASTOR internal path.
Definition: TCastorFile.h:24
virtual ~TCastorFile()
Definition: TCastorFile.h:40