Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RRawFileNetXNG.hxx
Go to the documentation of this file.
1// @(#)root/io:$Id$
2// Author: Michal Simon
3
4/*************************************************************************
5 * Copyright (C) 1995-2018, 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 NET_NETXNG_INC_ROOT_RRAWFILENETXNG_HXX_
13#define NET_NETXNG_INC_ROOT_RRAWFILENETXNG_HXX_
14
15#include <ROOT/RRawFile.hxx>
16#include <memory>
17#include <optional>
18
19namespace ROOT {
20namespace Internal {
21
23
24/** \class RRawFileNetXNG RRawFileNetXNG.hxx
25
26The RRawFileNetXNG class provides read-only access to remote files using root/roots protocol. It uses the
27XrdCl (XRootD client) library for the transport layer. It instructs the RRawFile base class to buffer in
28larger chunks than the default for local files, assuming that remote file access has high(er) latency.
29
30*/
31
33{
34private:
35 std::unique_ptr<RRawFileNetXNGImpl> pImpl; ///< pointer to implementation
36 std::optional<RIOVecLimits> fIOVecLimits; ///< Set by GetReadVLimits and then cached
37
38protected:
39 void OpenImpl() final;
40 size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final;
41 void ReadVImpl(RIOVec *ioVec, unsigned int nReq) final;
42 std::uint64_t GetSizeImpl() final;
43
44public:
45 RRawFileNetXNG(std::string_view url, RRawFile::ROptions options);
47 std::unique_ptr<RRawFile> Clone() const final;
49};
50
51} // namespace Internal
52} // namespace ROOT
53
54#endif /* NET_NETXNG_INC_ROOT_RRAWFILENETXNG_HXX_ */
void OpenImpl() final
OpenImpl() is called at most once and before any call to either DoReadAt or DoGetSize.
std::unique_ptr< RRawFileNetXNGImpl > pImpl
pointer to implementation
RIOVecLimits GetReadVLimits() final
Returns the limits regarding the ioVec input to ReadV for this specific file; may open the file as a ...
void ReadVImpl(RIOVec *ioVec, unsigned int nReq) final
By default implemented as a loop of ReadAt calls but can be overwritten, e.g. XRootD or DAVIX impleme...
RRawFileNetXNG(std::string_view url, RRawFile::ROptions options)
std::optional< RIOVecLimits > fIOVecLimits
Set by GetReadVLimits and then cached.
std::unique_ptr< RRawFile > Clone() const final
Create a new RawFile that accesses the same resource. The file pointer is reset to zero.
size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final
Derived classes should implement low-level reading without buffering.
std::uint64_t GetSizeImpl() final
Derived classes should return the file size.
RRawFile(std::string_view url, ROptions options)
Definition RRawFile.cxx:61
STL class.
STL class.
Implementations may enforce limits on the use of vector reads.
Definition RRawFile.hxx:75
Used for vector reads from multiple offsets into multiple buffers.
Definition RRawFile.hxx:61
On construction, an ROptions parameter can customize the RRawFile behavior.
Definition RRawFile.hxx:49