Logo ROOT  
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
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
TFileStager::IsValid
virtual Bool_t IsValid() const
Definition: TFileStager.h:50
f
#define f(i)
Definition: RSha256.hxx:122
fc
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:3728
TNamed.h
TFileStager::GetPathName
static TString GetPathName(TObject *o)
Return the path name contained in object 'o' allowing for TUrl, TObjString or TFileInfo.
Definition: TFileStager.cxx:188
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
Int_t
int Int_t
Definition: RtypesCore.h:45
TNamed::fName
TString fName
Definition: TNamed.h:38
TString
Definition: TString.h:136
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TFileStager::GetStaged
virtual TList * GetStaged(TCollection *pathlist)
Retrieves the staging (online) status for a list of path names.
Definition: TFileStager.cxx:46
TFileStager::TFileStager
TFileStager(const char *stager)
Definition: TFileStager.h:39
TString.h
bool
TFileStager::LocateCollection
virtual Int_t LocateCollection(TFileCollection *fc, Bool_t addDummyUrl=kFALSE)
Massive location of files.
Definition: TFileStager.cxx:158
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TFileStager
Definition: TFileStager.h:36
TFileStager::Stage
virtual Bool_t Stage(const char *, Option_t *=0)
Definition: TFileStager.h:47
TNamed
Definition: TNamed.h:29
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TFileStager::Open
static TFileStager * Open(const char *stager)
Open a stager, after having loaded the relevant plug-in.
Definition: TFileStager.cxx:101
TFileStager::~TFileStager
virtual ~TFileStager()
Definition: TFileStager.h:40
TFileStager::Matches
virtual Bool_t Matches(const char *s)
Definition: TFileStager.h:46
TFileStager::IsStaged
virtual Bool_t IsStaged(const char *)
Just check if the file exists locally.
Definition: TFileStager.cxx:125
TFileStager::Locate
virtual Int_t Locate(const char *u, TString &f)
Just check if the file exists locally.
Definition: TFileStager.cxx:146
TCollection
Definition: TCollection.h:63
TList
Definition: TList.h:44
TFileCollection
Definition: TFileCollection.h:39