#include <StorageAccountProxy.h>
Public Member Functions | |
virtual void | close (void) |
virtual void | flush (void) |
virtual IOOffset | position (IOOffset offset, Relative whence=SET) |
virtual bool | prefetch (const IOPosBuffer *what, IOSize n) |
virtual IOSize | read (void *into, IOSize n) |
virtual IOSize | read (void *into, IOSize n, IOOffset pos) |
virtual IOSize | readv (IOBuffer *into, IOSize n) |
virtual IOSize | readv (IOPosBuffer *into, IOSize n) |
virtual void | resize (IOOffset size) |
StorageAccountProxy (const std::string &storageClass, std::unique_ptr< Storage > baseStorage) | |
virtual IOSize | write (const void *from, IOSize n) |
virtual IOSize | write (const void *from, IOSize n, IOOffset pos) |
virtual IOSize | writev (const IOBuffer *from, IOSize n) |
virtual IOSize | writev (const IOPosBuffer *from, IOSize n) |
~StorageAccountProxy (void) | |
Public Member Functions inherited from Storage | |
virtual bool | eof (void) const |
virtual IOOffset | position (void) const |
IOSize | read (IOBuffer into, IOOffset pos) |
virtual void | rewind (void) |
virtual IOOffset | size (void) const |
Storage (void) | |
IOSize | write (IOBuffer from, IOOffset pos) |
virtual | ~Storage (void) |
Public Member Functions inherited from IOInput | |
int | read (void) |
IOSize | read (IOBuffer into) |
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 | |
IOSize | write (unsigned char byte) |
IOSize | write (IOBuffer from) |
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... | |
Protected Member Functions | |
void | releaseStorage () |
Additional Inherited Members | |
Public Types inherited from Storage | |
enum | Relative { SET, CURRENT, END } |
Proxy class that wraps SEAL's Storage class with one that ticks StorageAccount counters for significant operations. The returned Storage objects from StorageMaker are automatically wrapped with this class.
Future improvement would be to implement more methods so that the wrapper itself doesn't cause peroformance degradation if the base storage does actually implement "sophisticated" features.
Definition at line 18 of file StorageAccountProxy.h.
StorageAccountProxy::StorageAccountProxy | ( | const std::string & | storageClass, |
std::unique_ptr< Storage > | baseStorage | ||
) |
Definition at line 3 of file StorageAccountProxy.cc.
References StorageAccount::construct, StorageAccount::counter(), m_token, and StorageAccount::Stamp::tick().
StorageAccountProxy::~StorageAccountProxy | ( | void | ) |
Definition at line 18 of file StorageAccountProxy.cc.
References StorageAccount::counter(), StorageAccount::destruct, m_token, releaseStorage(), and StorageAccount::Stamp::tick().
|
virtual |
Reimplemented from Storage.
Definition at line 123 of file StorageAccountProxy.cc.
References StorageAccount::close, StorageAccount::counter(), m_baseStorage, m_token, and StorageAccount::Stamp::tick().
Referenced by lumiQTWidget.ApplicationWindow::fileQuit(), esMonitoring.AsyncLineReaderMixin::handle_close(), esMonitoring.FDJsonServer::handle_close(), Vispa.Gui.BoxContentDialog.BoxContentDialog::keyPressEvent(), and Vispa.Gui.FindDialog.FindDialog::keyPressEvent().
|
virtual |
Reimplemented from Storage.
Definition at line 115 of file StorageAccountProxy.cc.
References StorageAccount::counter(), StorageAccount::flush, m_baseStorage, m_token, and StorageAccount::Stamp::tick().
Implements Storage.
Definition at line 98 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsPosition, query::result, and StorageAccount::Stamp::tick().
|
virtual |
Reimplemented from Storage.
Definition at line 131 of file StorageAccountProxy.cc.
References i, m_baseStorage, m_statsPrefetch, gen::n, Storage::size(), StorageAccount::Stamp::tick(), pileupDistInMC::total, and relativeConstraints::value.
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). |
Implements IOInput.
Definition at line 26 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsRead, query::result, and StorageAccount::Stamp::tick().
Reimplemented from Storage.
Definition at line 35 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsRead, query::result, and StorageAccount::Stamp::tick().
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. |
Reimplemented from IOInput.
Definition at line 44 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsReadV, query::result, and StorageAccount::Stamp::tick().
|
virtual |
Reimplemented from Storage.
Definition at line 53 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsReadV, query::result, and StorageAccount::Stamp::tick().
|
inlineprotected |
Definition at line 43 of file StorageAccountProxy.h.
References edm::get_underlying_safe(), and m_baseStorage.
Referenced by ~StorageAccountProxy().
|
virtual |
Implements Storage.
Definition at line 107 of file StorageAccountProxy.cc.
References StorageAccount::counter(), m_baseStorage, m_token, StorageAccount::resize, and StorageAccount::Stamp::tick().
Referenced by Vispa.Gui.TextDialog.TextDialog::__init__(), Vispa.Plugins.ConfigEditor.ToolDialog.ToolDialog::__init__(), Vispa.Main.MainWindow.MainWindow::_loadIni(), and Vispa.Gui.PortConnection.PointToPointConnection::updateConnection().
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. |
Implements IOOutput.
Definition at line 62 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsWrite, query::result, and StorageAccount::Stamp::tick().
Reimplemented from Storage.
Definition at line 71 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsWrite, query::result, and StorageAccount::Stamp::tick().
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. |
Reimplemented from IOOutput.
Definition at line 80 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsWriteV, query::result, and StorageAccount::Stamp::tick().
|
virtual |
Reimplemented from Storage.
Definition at line 89 of file StorageAccountProxy.cc.
References m_baseStorage, m_statsWriteV, query::result, and StorageAccount::Stamp::tick().
|
protected |
Definition at line 45 of file StorageAccountProxy.h.
Referenced by close(), flush(), position(), prefetch(), read(), readv(), releaseStorage(), resize(), write(), and writev().
|
protected |
Definition at line 52 of file StorageAccountProxy.h.
Referenced by position().
|
protected |
Definition at line 53 of file StorageAccountProxy.h.
Referenced by prefetch().
|
protected |
Definition at line 48 of file StorageAccountProxy.h.
Referenced by read().
|
protected |
Definition at line 49 of file StorageAccountProxy.h.
Referenced by readv().
|
protected |
Definition at line 50 of file StorageAccountProxy.h.
Referenced by write().
|
protected |
Definition at line 51 of file StorageAccountProxy.h.
Referenced by writev().
|
protected |
Definition at line 47 of file StorageAccountProxy.h.
Referenced by close(), flush(), resize(), StorageAccountProxy(), and ~StorageAccountProxy().