Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:10:48

0001 // @(#)root/io:$Id$
0002 // Author: Michal Simon
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef NET_NETXNG_INC_ROOT_RRAWFILENETXNG_HXX_
0013 #define NET_NETXNG_INC_ROOT_RRAWFILENETXNG_HXX_
0014 
0015 #include <ROOT/RRawFile.hxx>
0016 #include <memory>
0017 #include <optional>
0018 
0019 namespace ROOT {
0020 namespace Internal {
0021 
0022 struct RRawFileNetXNGImpl;
0023 
0024 /** \class RRawFileNetXNG RRawFileNetXNG.hxx
0025 
0026 The RRawFileNetXNG class provides read-only access to remote files using root/roots protocol. It uses the
0027 XrdCl (XRootD client) library for the transport layer.  It instructs the RRawFile base class to buffer in
0028 larger chunks than the default for local files, assuming that remote file access has high(er) latency.
0029 
0030 */
0031 
0032 class RRawFileNetXNG : public RRawFile
0033 {
0034 private:
0035    std::unique_ptr<RRawFileNetXNGImpl> pImpl; ///< pointer to implementation
0036    std::optional<RIOVecLimits> fIOVecLimits;  ///< Set by GetReadVLimits and then cached
0037 
0038 protected:
0039    void OpenImpl() final;
0040    size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final;
0041    void ReadVImpl(RIOVec *ioVec, unsigned int nReq) final;
0042    std::uint64_t GetSizeImpl() final;
0043 
0044 public:
0045    RRawFileNetXNG(std::string_view url, RRawFile::ROptions options);
0046    ~RRawFileNetXNG();
0047    std::unique_ptr<RRawFile> Clone() const final;
0048    int GetFeatures() const final { return kFeatureHasSize | kFeatureHasAsyncIo; }
0049    RIOVecLimits GetReadVLimits() final;
0050 };
0051 
0052 } // namespace Internal
0053 } // namespace ROOT
0054 
0055 #endif /* NET_NETXNG_INC_ROOT_RRAWFILENETXNG_HXX_ */