Logo ROOT   6.10/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 #include "TNamed.h"
31 #include "TString.h"
32 
33 class TCollection;
34 class TFileCollection;
35 
36 class TFileStager : public TNamed {
37 
38 public:
39  TFileStager(const char *stager) : TNamed(stager, stager) { }
40  virtual ~TFileStager() { }
41 
42  virtual TList *GetStaged(TCollection *pathlist);
43  virtual Bool_t IsStaged(const char *);
44  virtual Int_t Locate(const char *u, TString &f);
45  virtual Int_t LocateCollection(TFileCollection *fc, Bool_t addDummyUrl = kFALSE);
46  virtual Bool_t Matches(const char *s) { return ((s && (fName == s)) ? kTRUE : kFALSE); }
47  virtual Bool_t Stage(const char *, Option_t * = 0) { return kTRUE; }
48  virtual Bool_t Stage(TCollection *pathlist, Option_t *opt = 0);
49 
50  virtual Bool_t IsValid() const { return kTRUE; }
51 
52  // Extract the path name from supported object types
53  static TString GetPathName(TObject *o);
54 
55  //--- Load desired plugin
56  static TFileStager *Open(const char *stager);
57 
58  ClassDef(TFileStager,0) // ABC defining interface to a stager
59 };
60 
61 #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 &#39;o&#39; 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:129
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:1956
#define ClassDef(name, id)
Definition: Rtypes.h:297
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
A doubly linked list.
Definition: TList.h:43
TFileStager(const char *stager)
Definition: TFileStager.h:39
Collection abstract base class.
Definition: TCollection.h:42
virtual Int_t LocateCollection(TFileCollection *fc, Bool_t addDummyUrl=kFALSE)
Massive location of files.
TString fName
Definition: TNamed.h:32
const Bool_t kFALSE
Definition: RtypesCore.h:92
virtual Bool_t Stage(const char *, Option_t *=0)
Definition: TFileStager.h:47
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:40
Mother of all ROOT objects.
Definition: TObject.h:37
Class that contains a list of TFileInfo&#39;s and accumulated meta data information about its entries...
virtual Bool_t Matches(const char *s)
Definition: TFileStager.h:46
virtual Bool_t IsValid() const
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: RtypesCore.h:91