#include <Storage.h>
Public Types | |
enum | Relative { SET, CURRENT, END } |
Public Member Functions | |
virtual void | close (void) |
virtual bool | eof (void) const |
virtual void | flush (void) |
virtual IOOffset | position (IOOffset offset, Relative whence=SET)=0 |
virtual IOOffset | position (void) const |
virtual bool | prefetch (const IOPosBuffer *what, IOSize n) |
IOSize | read (IOBuffer into) |
IOSize | read (IOBuffer into, IOOffset pos) |
virtual IOSize | read (void *into, IOSize n)=0 |
virtual IOSize | read (void *into, IOSize n, IOOffset pos) |
int | read (void) |
virtual IOSize | readv (IOBuffer *into, IOSize buffers) |
virtual IOSize | readv (IOPosBuffer *into, IOSize buffers) |
virtual void | resize (IOOffset size)=0 |
virtual void | rewind (void) |
virtual IOOffset | size (void) const |
Storage (void) | |
virtual IOSize | write (const void *from, IOSize n)=0 |
virtual IOSize | write (const void *from, IOSize n, IOOffset pos) |
IOSize | write (IOBuffer from) |
IOSize | write (IOBuffer from, IOOffset pos) |
IOSize | write (unsigned char byte) |
virtual IOSize | writev (const IOBuffer *from, IOSize buffers) |
virtual IOSize | writev (const IOPosBuffer *from, IOSize buffers) |
~Storage (void) override | |
Public Member Functions inherited from IOInput | |
IOSize | read (IOBuffer into) |
virtual IOSize | read (void *into, IOSize n)=0 |
int | read (void) |
virtual IOSize | readv (IOBuffer *into, IOSize buffers) |
IOSize | xread (IOBuffer into) |
IOSize | xread (void *into, IOSize n) |
IOSize | xreadv (IOBuffer *into, IOSize buffers) |
virtual | ~IOInput (void) |
Destruct the stream. A no-op. More... | |
Public Member Functions inherited from IOOutput | |
virtual IOSize | write (const void *from, IOSize n)=0 |
IOSize | write (IOBuffer from) |
IOSize | write (unsigned char byte) |
virtual IOSize | writev (const IOBuffer *from, IOSize buffers) |
IOSize | xwrite (const void *from, IOSize n) |
IOSize | xwrite (IOBuffer from) |
IOSize | xwritev (const IOBuffer *from, IOSize buffers) |
virtual | ~IOOutput (void) |
Destruct the stream. A no-op. More... | |
Private Member Functions | |
Storage & | operator= (const Storage &)=delete |
Storage (const Storage &)=delete | |
enum Storage::Relative |
Storage::Storage | ( | void | ) |
Definition at line 5 of file Storage.cc.
|
override |
Definition at line 7 of file Storage.cc.
|
privatedelete |
|
virtual |
Reimplemented in File, XrdFile, StorageAccountProxy, DCacheFile, LocalCacheFile, DavixFile, LStoreFile, and RemoteFile.
Definition at line 95 of file Storage.cc.
Referenced by esMonitoring.AsyncLineReaderMixin::handle_close(), and esMonitoring.FDJsonServer::handle_close().
|
virtual |
Definition at line 98 of file Storage.cc.
References position(), and size().
|
virtual |
Reimplemented in File, StorageAccountProxy, and LocalCacheFile.
Definition at line 93 of file Storage.cc.
Implemented in File, XrdFile, StorageAccountProxy, DCacheFile, LocalCacheFile, DavixFile, and LStoreFile.
|
virtual |
Definition at line 72 of file Storage.cc.
References CURRENT.
Referenced by eof(), read(), lhef::StorageInputStream::readBytes(), readv(), rewind(), size(), lhef::StorageInputStream::StorageInputStream(), and write().
|
virtual |
Reimplemented in XrdFile, File, StorageAccountProxy, and LocalCacheFile.
Definition at line 90 of file Storage.cc.
IOSize IOInput::read |
Read from the input stream into the buffer starting at into and of size n.
If this is a blocking stream, the call will block until some data can be read, end of input is reached, or an exception is thrown. For a non-blocking stream the available input is returned. If none is available, an exception is thrown.
The base class implementation simply forwards the call to read(void *, IOSize) method.
In | case of error, a #IOError exception is thrown. This includes the situation where the input stream is in non-blocking mode and no input is currently available (FIXME: make this simpler; clarify which exception). |
Definition at line 80 of file IOInput.cc.
Definition at line 10 of file Storage.cc.
References IOBuffer::data(), IOInput::read(), and IOBuffer::size().
IOSize IOInput::read |
Read into into at most n number of bytes.
If this is a blocking stream, the call will block until some data can be read, end of input is reached, or an exception is thrown. For a non-blocking stream the available input is returned. If none is available, an exception is thrown.
In | case of error, a #IOError exception is thrown. This includes the situation where the input stream is in non-blocking mode and no input is currently available (FIXME: make this simpler; clarify which exception). |
Reimplemented in XrdFile, File, StorageAccountProxy, and LocalCacheFile.
Definition at line 12 of file Storage.cc.
References dqmiodumpmetadata::n, position(), and IOInput::read().
Referenced by PixelSLinkDataInputSource::PixelSLinkDataInputSource(), lhef::StorageInputStream::readBytes(), PixelSLinkDataInputSource::setRunAndEventInfo(), and lhef::StorageInputStream::StorageInputStream().
int IOInput::read |
Read the next single byte from the input stream and return it as an unsigned
char
cast to an int
, -1 to indicate end of intput data.
If this is a blocking stream, the call will block until the byte can be read, end of data is reached, or an exception is thrown. For a non-blocking input a character is returned if one is available, otherwise an exception is thrown.
The base class implementation simply forwards the call to read(void *, IOSize) method.
unsigned char
to an int
(in range 0...255, inclusive) if one could be read, or -1
to indicate end of input data.In | case of error, a #IOError exception is thrown. This includes the situation where the input stream is in non-blocking mode and no input is currently available (FIXME: make this simpler; clarify which exception). |
Definition at line 52 of file IOInput.cc.
IOSize IOInput::readv |
Read from the input stream into multiple scattered buffers. There are buffers to fill in an array starting at into; the memory those buffers occupy does not need to be contiguous. The buffers are filled in the order given, eac buffer is filled fully before the subsequent buffers.
If this is a blocking stream, the call will block until some data can be read, end of input is reached, or an exception is thrown. For a non-blocking stream the available input is returned. If none is available, an exception is thrown.
The base class implementation uses read(void *, IOSize) method, but derived classes may implement a more efficient alternative.
In | case of error, a #IOError exception is thrown. However if some data has already been read, the error is swallowed and the method returns the data read so far. It is assumed that persistent errors will occur anyway on the next read and sporadic errors like stream becoming unvailable can be ignored. Use xread() if a different policy is desirable. |
Definition at line 111 of file IOInput.cc.
|
virtual |
Reimplemented in XrdFile, StorageAccountProxy, LocalCacheFile, DavixFile, and DCacheFile.
Definition at line 24 of file Storage.cc.
References data, mps_fire::i, dqmiodumpmetadata::n, hltrates_dqm_sourceclient-live_cfg::offset, position(), IOInput::read(), size(), and dqmMemoryStats::total.
|
pure virtual |
Implemented in File, XrdFile, StorageAccountProxy, DCacheFile, LocalCacheFile, DavixFile, and LStoreFile.
|
virtual |
|
virtual |
Reimplemented in File.
Definition at line 77 of file Storage.cc.
References END, and position().
Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), eof(), StorageAccountProxy::prefetch(), LocalCacheFile::readv(), readv(), XrdFile::readv(), StorageAccountProxy::resize(), and writev().
IOSize IOOutput::write |
Write n bytes of data starting at address from.
In | case of error, an exception is thrown. However if the stream is in non-blocking mode and cannot accept output, it will not throw an exception – the return value will be less than requested. |
Reimplemented in XrdFile, File, StorageAccountProxy, and LocalCacheFile.
Definition at line 44 of file Storage.cc.
References dqmiodumpmetadata::n, and position().
IOSize IOOutput::write |
Write to the output stream the buffer from. This method is simply redirected to write(const void *, IOSize).
Note that derived classes should not normally call this method, as it simply routes the call back to derived class through the other virtual functions. Use this method only at the "outside edge" when transferring calls from one object to another, not in up/down calls in the inheritance tree.
In | case of error, an exception is thrown. However if the stream is in non-blocking mode and cannot accept output, it will not throw an exception – the return value will be less than requested. |
Definition at line 59 of file IOOutput.cc.
Definition at line 42 of file Storage.cc.
References IOBuffer::data(), IOBuffer::size(), and write().
IOSize IOOutput::write |
Write a single byte to the output stream. This method is simply redirected to write(const void *, IOSize).
Note that derived classes should not normally call this method, as it simply routes the call back to derived class through the other virtual functions. Use this method only at the "outside edge" when transferring calls from one object to another, not in up/down calls in the inheritance tree.
In | case of error, an exception is thrown. However if the stream is in non-blocking mode and cannot accept output, it will not throw an exception – zero will be returned. |
Definition at line 39 of file IOOutput.cc.
IOSize IOOutput::writev |
Write to the output stream from multiple buffers. There are buffers to fill in an array starting at from. The buffers are filled in the order given, each buffer fully before the subsequent buffers. The method uses write(const void *, IOSize), but may be implemented more efficiently in derived classes.
Note that derived classes should not normally call this method, as it simply routes the call back to derived class through the other virtual functions. Use this method only at the "outside edge" when transferring calls from one object to another, not in up/down calls in the inheritance tree.
In | case of error, an exception is thrown. However if the stream is in non-blocking mode and cannot accept output, it will not throw an exception – the return value will be less than requested. |
Definition at line 84 of file IOOutput.cc.
|
virtual |
Reimplemented in StorageAccountProxy, and LocalCacheFile.
Definition at line 57 of file Storage.cc.
References data, mps_fire::i, dqmiodumpmetadata::n, hltrates_dqm_sourceclient-live_cfg::offset, size(), dqmMemoryStats::total, and write().