Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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