Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RRawFileUnix.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_RRawFileUnix
13#define ROOT_RRawFileUnix
14
15#include <ROOT/RRawFile.hxx>
16#include <string_view>
17
18#include <cstddef>
19#include <cstdint>
20
21namespace ROOT {
22namespace Internal {
23
24/**
25 * \class RRawFileUnix RRawFileUnix.hxx
26 * \ingroup IO
27 *
28 * The RRawFileUnix class uses POSIX calls to read from a mounted file system. Thus the path name can refer,
29 * for instance, to a named pipe instead of a regular file.
30 */
31class RRawFileUnix : public RRawFile {
32private:
34
35protected:
36 void OpenImpl() final;
37 size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final;
38 void ReadVImpl(RIOVec *ioVec, unsigned int nReq) final;
39 std::uint64_t GetSizeImpl() final;
40 void *MapImpl(size_t nbytes, std::uint64_t offset, std::uint64_t &mapdOffset) final;
41 void UnmapImpl(void *region, size_t nbytes) final;
42
43public:
44 RRawFileUnix(std::string_view url, RRawFile::ROptions options);
45 ~RRawFileUnix() override;
46 std::unique_ptr<RRawFile> Clone() const final;
47 int GetFeatures() const final;
48 int GetFd() const { return fFileDes; }
49};
50
51} // namespace Internal
52} // namespace ROOT
53
54#endif
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
The RRawFileUnix class uses POSIX calls to read from a mounted file system.
void UnmapImpl(void *region, size_t nbytes) final
Derived classes with mmap support must be able to unmap the memory area handed out by Map()
std::unique_ptr< RRawFile > Clone() const final
Create a new RawFile that accesses the same resource. The file pointer is reset to zero.
std::uint64_t GetSizeImpl() final
Derived classes should return the file size or kUnknownFileSize.
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...
int GetFeatures() const final
Derived classes shall inform the user about the supported functionality, which can possibly depend on...
void * MapImpl(size_t nbytes, std::uint64_t offset, std::uint64_t &mapdOffset) final
If a derived class supports mmap, the MapImpl and UnmapImpl calls are supposed to be implemented,...
void OpenImpl() final
OpenImpl() is called at most once and before any call to either DoReadAt or DoGetSize.
size_t ReadAtImpl(void *buffer, size_t nbytes, std::uint64_t offset) final
Derived classes should implement low-level reading without buffering.
The RRawFile provides read-only access to local and remote files.
Definition RRawFile.hxx:43
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Used for vector reads from multiple offsets into multiple buffers.
Definition RRawFile.hxx:71
On construction, an ROptions parameter can customize the RRawFile behavior.
Definition RRawFile.hxx:59