Project
Loading...
Searching...
No Matches
o2::aod::native::ByteSource Class Referenceabstract

#include <ByteSource.h>

Inherited by o2::aod::native::HttpByteSource, o2::aod::native::LocalByteSource, o2::aod::native::PlannedByteSource, o2::aod::native::XRootDByteSource, and o2::aod::native::test::MemoryByteSource.

Public Member Functions

virtual ~ByteSource ()
 
virtual uint64_t size () const =0
 
virtual void readInto (uint64_t off, size_t len, void *dst)=0
 Throws IoError, or CorruptData when the range is past the end of the file.
 
virtual void readvInto (std::span< ReadRequest > requests)=0
 
virtual std::span< const uint8_t > tryMap (uint64_t off, size_t len)
 A view of the bytes without copying them, if the backend can provide it.
 
virtual bool canMap () const
 Whether tryMap() provides every range, so that nothing needs reading.
 
virtual bool isRemote () const
 Whether each read is a network round trip, worth hiding behind decoding.
 
virtual void willNeed (uint64_t off, size_t len)
 Hints that a range will be needed soon, or is no longer needed.
 
virtual void dontNeed (uint64_t off, size_t len)
 
virtual uint64_t bytesRead () const =0
 
virtual uint64_t readCalls () const =0
 
virtual std::string url () const =0
 

Static Public Member Functions

static std::unique_ptr< ByteSource > open (std::string url, const Options &)
 

Detailed Description

Random access to the bytes of a file. Everything above this is I/O-agnostic. The caller always owns the destination. Implementations are thread-safe for concurrent reads.

Definition at line 55 of file ByteSource.h.

Constructor & Destructor Documentation

◆ ~ByteSource()

o2::aod::native::ByteSource::~ByteSource ( )
virtualdefault

Member Function Documentation

◆ bytesRead()

◆ canMap()

virtual bool o2::aod::native::ByteSource::canMap ( ) const
inlinevirtual

Whether tryMap() provides every range, so that nothing needs reading.

Reimplemented in o2::aod::native::LocalByteSource.

Definition at line 66 of file ByteSource.h.

◆ dontNeed()

virtual void o2::aod::native::ByteSource::dontNeed ( uint64_t  off,
size_t  len 
)
inlinevirtual

Reimplemented in o2::aod::native::LocalByteSource.

Definition at line 71 of file ByteSource.h.

◆ isRemote()

virtual bool o2::aod::native::ByteSource::isRemote ( ) const
inlinevirtual

Whether each read is a network round trip, worth hiding behind decoding.

Reimplemented in o2::aod::native::HttpByteSource, and o2::aod::native::XRootDByteSource.

Definition at line 68 of file ByteSource.h.

◆ open()

std::unique_ptr< ByteSource > o2::aod::native::ByteSource::open ( std::string  url,
const Options &  options 
)
static

Definition at line 27 of file ByteSource.cxx.

◆ readCalls()

◆ readInto()

virtual void o2::aod::native::ByteSource::readInto ( uint64_t  off,
size_t  len,
void *  dst 
)
pure virtual

◆ readvInto()

◆ size()

◆ tryMap()

virtual std::span< const uint8_t > o2::aod::native::ByteSource::tryMap ( uint64_t  off,
size_t  len 
)
inlinevirtual

A view of the bytes without copying them, if the backend can provide it.

Reimplemented in o2::aod::native::PlannedByteSource, o2::aod::native::LocalByteSource, and o2::aod::native::test::MemoryByteSource.

Definition at line 64 of file ByteSource.h.

◆ url()

◆ willNeed()

virtual void o2::aod::native::ByteSource::willNeed ( uint64_t  off,
size_t  len 
)
inlinevirtual

Hints that a range will be needed soon, or is no longer needed.

Reimplemented in o2::aod::native::LocalByteSource.

Definition at line 70 of file ByteSource.h.


The documentation for this class was generated from the following files: