Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TNetXNGSystem.h
Go to the documentation of this file.
1// @(#)root/netxng:$Id$
2/*************************************************************************
3 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. *
4 * All rights reserved. *
5 * *
6 * For the licensing terms see $ROOTSYS/LICENSE. *
7 * For the list of contributors see $ROOTSYS/README/CREDITS. *
8 *************************************************************************/
9
10#ifndef ROOT_TNetXNGSystem
11#define ROOT_TNetXNGSystem
12
13////////////////////////////////////////////////////////////////////////////////
14// //
15// TNetXNGSystem //
16// //
17// Authors: Justin Salmon, Lukasz Janyst //
18// CERN, 2013 //
19// //
20////////////////////////////////////////////////////////////////////////////////
21
22#include "TSystem.h"
23#include "TCollection.h"
24#include "TMutex.h"
25#include "THashList.h"
26#include <set>
27
28namespace XrdCl {
29 class FileSystem;
30 class URL;
31 class DirectoryList;
32}
33
34/// Enables access to XRootD filesystem interface using the new client.
35class TNetXNGSystem: public TSystem {
36
37private:
38 std::set<void *> fDirPtrs;
39 static THashList fgAddrFQDN; // Cache of addresses to FQDNs
40 static TMutex fgAddrMutex; // Serialise access to the FQDN list
41private:
42 XrdCl::URL *fUrl; // URL of this TSystem
43 XrdCl::FileSystem *fFileSystem; // Cached for convenience
44
45public:
46 TNetXNGSystem(Bool_t owner = kTRUE);
47 TNetXNGSystem(const char *url, Bool_t owner = kTRUE);
48 virtual ~TNetXNGSystem();
49
50 void *OpenDirectory(const char *dir) override;
51 Int_t MakeDirectory(const char *dir) override;
52 void FreeDirectory(void *dirp) override;
53 const char *GetDirEntry(void *dirp) override;
54 Int_t GetPathInfo(const char *path, FileStat_t &buf) override;
55 Bool_t ConsistentWith(const char *path, void *dirptr) override;
56 int Unlink(const char *path) override;
57 Bool_t IsPathLocal(const char *path) override;
58
59 virtual Int_t Locate(const char *path, TString &endurl);
60 virtual Int_t Stage(const char *path, UChar_t priority);
62
63 ClassDefOverride(TNetXNGSystem, 0) // ROOT class definition
64};
65
66#endif
unsigned char UChar_t
Definition RtypesCore.h:38
constexpr Bool_t kTRUE
Definition RtypesCore.h:93
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
Collection abstract base class.
Definition TCollection.h:65
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Definition THashList.h:34
Enables access to XRootD filesystem interface using the new client.
Bool_t ConsistentWith(const char *path, void *dirptr) override
Check consistency of this helper with the one required by 'path' or 'dirptr'.
int Unlink(const char *path) override
Unlink a file on the remote server.
XrdCl::FileSystem * fFileSystem
static TMutex fgAddrMutex
void * OpenDirectory(const char *dir) override
Open a directory.
std::set< void * > fDirPtrs
static THashList fgAddrFQDN
Int_t GetPathInfo(const char *path, FileStat_t &buf) override
Get info about a file (stat)
const char * GetDirEntry(void *dirp) override
Get a directory entry.
XrdCl::URL * fUrl
virtual Int_t Stage(const char *path, UChar_t priority)
Issue a stage request for a single file.
virtual Int_t Locate(const char *path, TString &endurl)
Get the endpoint URL of a file.
void FreeDirectory(void *dirp) override
Free a directory.
TNetXNGSystem(Bool_t owner=kTRUE)
Constructor: Create system class without connecting to server.
virtual ~TNetXNGSystem()
Destructor.
Bool_t IsPathLocal(const char *path) override
Is this path a local path?
Int_t MakeDirectory(const char *dir) override
Create a directory.
Basic string class.
Definition TString.h:139
Abstract base class defining a generic interface to the underlying Operating System.
Definition TSystem.h:276