ROOT  6.06/09
Reference Guide
TFileStager.h
Go to the documentation of this file.
1 // @(#)root/net:$Id$
2 // Author: A. Peters, G. Ganis 7/2/2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2002, 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_TFileStager
13 #define ROOT_TFileStager
14 
15 //////////////////////////////////////////////////////////////////////////
16 // //
17 // TFileStager //
18 // //
19 // Abstract base class defining an interface to a stager. //
20 // //
21 // To open a connection to a stager use the static method //
22 // Open("<stager>"), where <stager> contains a keyword allowing to load //
23 // the relevant plug-in, e.g. //
24 // TFileStager::Open("root://lxb6064.cern.ch") //
25 // will load TXNetFileStager and initialize it for the redirector at //
26 // lxb6046.cern.ch . //
27 // //
28 //////////////////////////////////////////////////////////////////////////
29 
30 #ifndef ROOT_TNamed
31 #include "TNamed.h"
32 #endif
33 #ifndef ROOT_TString
34 #include "TString.h"
35 #endif
36 
37 class TCollection;
38 class TFileCollection;
39 
40 class TFileStager : public TNamed {
41 
42 public:
43  TFileStager(const char *stager) : TNamed(stager, stager) { }
44  virtual ~TFileStager() { }
45 
46  virtual TList *GetStaged(TCollection *pathlist);
47  virtual Bool_t IsStaged(const char *);
48  virtual Int_t Locate(const char *u, TString &f);
49  virtual Int_t LocateCollection(TFileCollection *fc, Bool_t addDummyUrl = kFALSE);
50  virtual Bool_t Matches(const char *s) { return ((s && (fName == s)) ? kTRUE : kFALSE); }
51  virtual Bool_t Stage(const char *, Option_t * = 0) { return kTRUE; }
52  virtual Bool_t Stage(TCollection *pathlist, Option_t *opt = 0);
53 
54  virtual Bool_t IsValid() const { return kTRUE; }
55 
56  // Extract the path name from supported object types
57  static TString GetPathName(TObject *o);
58 
59  //--- Load desired plugin
60  static TFileStager *Open(const char *stager);
61 
62  ClassDef(TFileStager,0) // ABC defining interface to a stager
63 };
64 
65 #endif
virtual Bool_t IsStaged(const char *)
Just check if the file exists locally.
static TString GetPathName(TObject *o)
Return the path name contained in object 'o' allowing for TUrl, TObjString or TFileInfo.
const char Option_t
Definition: RtypesCore.h:62
virtual TList * GetStaged(TCollection *pathlist)
Retrieves the staging (online) status for a list of path names.
Definition: TFileStager.cxx:47
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
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:839
#define ClassDef(name, id)
Definition: Rtypes.h:254
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:33
virtual Bool_t IsValid() const
Definition: TFileStager.h:54
A doubly linked list.
Definition: TList.h:47
TFileStager(const char *stager)
Definition: TFileStager.h:43
Collection abstract base class.
Definition: TCollection.h:48
virtual Int_t LocateCollection(TFileCollection *fc, Bool_t addDummyUrl=kFALSE)
Massive location of files.
TString fName
Definition: TNamed.h:36
virtual Bool_t Stage(const char *, Option_t *=0)
Definition: TFileStager.h:51
double f(double x)
static TFileStager * Open(const char *stager)
Open a stager, after having loaded the relevant plug-in.
virtual ~TFileStager()
Definition: TFileStager.h:44
Mother of all ROOT objects.
Definition: TObject.h:58
Class that contains a list of TFileInfo's and accumulated meta data information about its entries...
virtual Bool_t Matches(const char *s)
Definition: TFileStager.h:50
virtual Int_t Locate(const char *u, TString &f)
Just check if the file exists locally.
const Bool_t kTRUE
Definition: Rtypes.h:91