Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:16:11

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 ////////////////////////////////////////////////////////////////////////////////
0021 
0022 #include "TSystem.h"
0023 #include "TCollection.h"
0024 #include "TMutex.h"
0025 #include "THashList.h"
0026 #include <set>
0027 
0028 namespace XrdCl {
0029    class FileSystem;
0030    class URL;
0031    class DirectoryList;
0032 }
0033 
0034 /// Enables access to XRootD filesystem interface using the new client.
0035 class TNetXNGSystem: public TSystem {
0036 
0037 private:
0038    std::set<void *>    fDirPtrs;
0039    static THashList   fgAddrFQDN;  // Cache of addresses to FQDNs
0040    static TMutex      fgAddrMutex; // Serialise access to the FQDN list
0041 private:
0042    XrdCl::URL        *fUrl;        // URL of this TSystem
0043    XrdCl::FileSystem *fFileSystem; // Cached for convenience
0044 
0045 public:
0046    TNetXNGSystem(Bool_t owner = kTRUE);
0047    TNetXNGSystem(const char *url, Bool_t owner = kTRUE);
0048    virtual ~TNetXNGSystem();
0049 
0050    void       *OpenDirectory(const char *dir) override;
0051    Int_t       MakeDirectory(const char *dir) override;
0052    void        FreeDirectory(void *dirp) override;
0053    const char *GetDirEntry(void *dirp) override;
0054    Int_t       GetPathInfo(const char *path, FileStat_t &buf) override;
0055    Bool_t      ConsistentWith(const char *path, void *dirptr) override;
0056    int         Unlink(const char *path) override;
0057    Bool_t      IsPathLocal(const char *path) override;
0058 
0059    virtual Int_t       Locate(const char *path, TString &endurl);
0060    virtual Int_t       Stage(const char *path, UChar_t priority);
0061    virtual Int_t       Stage(TCollection *files, UChar_t priority);
0062 
0063    ClassDefOverride(TNetXNGSystem, 0)  // ROOT class definition
0064 };
0065 
0066 #endif