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
33class TCollection;
34class TFileCollection;
35
36class TFileStager : public TNamed {
37
38public:
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
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:326
static struct mg_connection * fc(struct mg_context *ctx)
Definition: civetweb.c:3728
Collection abstract base class.
Definition: TCollection.h:63
Class that contains a list of TFileInfo's and accumulated meta data information about its entries.
TFileStager(const char *stager)
Definition: TFileStager.h:39
virtual Int_t LocateCollection(TFileCollection *fc, Bool_t addDummyUrl=kFALSE)
Massive location of files.
virtual Bool_t Matches(const char *s)
Definition: TFileStager.h:46
virtual Bool_t IsValid() const
Definition: TFileStager.h:50
virtual Bool_t IsStaged(const char *)
Just check if the file exists locally.
virtual Bool_t Stage(const char *, Option_t *=0)
Definition: TFileStager.h:47
static TString GetPathName(TObject *o)
Return the path name contained in object 'o' allowing for TUrl, TObjString or TFileInfo.
static TFileStager * Open(const char *stager)
Open a stager, after having loaded the relevant plug-in.
virtual TList * GetStaged(TCollection *pathlist)
Retrieves the staging (online) status for a list of path names.
Definition: TFileStager.cxx:47
virtual ~TFileStager()
Definition: TFileStager.h:40
virtual Int_t Locate(const char *u, TString &f)
Just check if the file exists locally.
A doubly linked list.
Definition: TList.h:44
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
TString fName
Definition: TNamed.h:32
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:131
static constexpr double s