Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
RRawFileDavix.hxx
Go to the documentation of this file.
1 // @(#)root/io:$Id$
2 // Author: Jakob Blomer
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 ROOT_RRawFileDavix
13 #define ROOT_RRawFileDavix
14 
15 #include <ROOT/RRawFile.hxx>
16 #include <ROOT/RStringView.hxx>
17 
18 #include <cstddef>
19 #include <cstdint>
20 #include <memory>
21 
22 namespace ROOT {
23 namespace Internal {
24 
25 struct RDavixFileDes;
26 
27 /**
28  * \class RRawFileDavix RRawFileDavix.hxx
29  *
30  * The RRawFileDavix class provides read-only access to remote non-ROOT files. It uses the Davix library for
31  * the transport layer. It instructs the RRawFile base class to buffer in larger chunks than the default for
32  * local files, assuming that remote file access has high(er) latency.
33  */
34 class RRawFileDavix : public RRawFile {
35 private:
36  std::unique_ptr<Internal::RDavixFileDes> fFileDes;
37 
38 protected:
39  void OpenImpl() final;
40  size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final;
41  std::uint64_t GetSizeImpl() final;
42 
43 public:
44  RRawFileDavix(std::string_view url, RRawFile::ROptions options);
45  ~RRawFileDavix();
46  std::unique_ptr<RRawFile> Clone() const final;
47  int GetFeatures() const final { return kFeatureHasSize; }
48 };
49 
50 } // namespace Internal
51 } // namespace ROOT
52 
53 #endif