Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:39

0001 // @(#)root/io:$Id$
0002 // Author: Jakob Blomer
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 ROOT_RRawFileUnix
0013 #define ROOT_RRawFileUnix
0014 
0015 #include <ROOT/RRawFile.hxx>
0016 #include <string_view>
0017 
0018 #include <cstddef>
0019 #include <cstdint>
0020 
0021 namespace ROOT {
0022 namespace Internal {
0023 
0024 /**
0025  * \class RRawFileUnix RRawFileUnix.hxx
0026  * \ingroup IO
0027  *
0028  * The RRawFileUnix class uses POSIX calls to read from a mounted file system. Thus the path name can refer,
0029  * for instance, to a named pipe instead of a regular file.
0030  */
0031 class RRawFileUnix : public RRawFile {
0032 private:
0033    int fFileDes;
0034 
0035 protected:
0036    void OpenImpl() final;
0037    size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final;
0038    void ReadVImpl(RIOVec *ioVec, unsigned int nReq) final;
0039    std::uint64_t GetSizeImpl() final;
0040    void *MapImpl(size_t nbytes, std::uint64_t offset, std::uint64_t &mapdOffset) final;
0041    void UnmapImpl(void *region, size_t nbytes) final;
0042 
0043 public:
0044    RRawFileUnix(std::string_view url, RRawFile::ROptions options);
0045    ~RRawFileUnix() override;
0046    std::unique_ptr<RRawFile> Clone() const final;
0047    int GetFeatures() const final;
0048    int GetFd() const { return fFileDes; }
0049 };
0050 
0051 } // namespace Internal
0052 } // namespace ROOT
0053 
0054 #endif