Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:12:17

0001 // @(#)root/netxng:$Id$
0002 /*************************************************************************
0003  * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers.               *
0004  * All rights reserved.                                                  *
0005  *                                                                       *
0006  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0007  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0008  *************************************************************************/
0009 
0010 #ifndef ROOT_TNetXNGSystem
0011 #define ROOT_TNetXNGSystem
0012 
0013 ////////////////////////////////////////////////////////////////////////////////
0014 //                                                                            //
0015 // TNetXNGSystem                                                              //
0016 //                                                                            //
0017 // Authors: Justin Salmon, Lukasz Janyst                                      //
0018 //          CERN, 2013                                                        //
0019 //                                                                            //
0020 // Enables access to XRootD filesystem interface using the new client.        //
0021 //                                                                            //
0022 ////////////////////////////////////////////////////////////////////////////////
0023 
0024 #include "TSystem.h"
0025 #include "TCollection.h"
0026 #include "TMutex.h"
0027 #include "THashList.h"
0028 #include <set>
0029 
0030 namespace XrdCl {
0031    class FileSystem;
0032    class URL;
0033    class DirectoryList;
0034 }
0035 
0036 class TNetXNGSystem: public TSystem {
0037 
0038 private:
0039    std::set<void *>    fDirPtrs;
0040    static THashList   fgAddrFQDN;  // Cache of addresses to FQDNs
0041    static TMutex      fgAddrMutex; // Serialise access to the FQDN list
0042 private:
0043    XrdCl::URL        *fUrl;        // URL of this TSystem
0044    XrdCl::FileSystem *fFileSystem; // Cached for convenience
0045 
0046 public:
0047    TNetXNGSystem(Bool_t owner = kTRUE);
0048    TNetXNGSystem(const char *url, Bool_t owner = kTRUE);
0049    virtual ~TNetXNGSystem();
0050 
0051    void       *OpenDirectory(const char *dir) override;
0052    Int_t       MakeDirectory(const char *dir) override;
0053    void        FreeDirectory(void *dirp) override;
0054    const char *GetDirEntry(void *dirp) override;
0055    Int_t       GetPathInfo(const char *path, FileStat_t &buf) override;
0056    Bool_t      ConsistentWith(const char *path, void *dirptr) override;
0057    int         Unlink(const char *path) override;
0058    Bool_t      IsPathLocal(const char *path) override;
0059 
0060    virtual Int_t       Locate(const char *path, TString &endurl);
0061    virtual Int_t       Stage(const char *path, UChar_t priority);
0062    virtual Int_t       Stage(TCollection *files, UChar_t priority);
0063 
0064    ClassDefOverride(TNetXNGSystem, 0)  // ROOT class definition
0065 };
0066 
0067 #endif