Isis 3 Programmer Reference
|
This class is designed to handle write() asynchronously. More...
Public Member Functions | |
BufferToChunkWriter (CubeIoHandler *ioHandler, QList< Buffer * > buffersToWrite) | |
Create a BufferToChunkWriter which is designed to asynchronously move the given buffers into the cube cache. | |
~BufferToChunkWriter () | |
We're done writing our buffers into the cube, clean up. | |
void | run () |
This is the asynchronous computation. | |
Private Member Functions | |
BufferToChunkWriter (const BufferToChunkWriter &other) | |
This is disabled. | |
BufferToChunkWriter & | operator= (const BufferToChunkWriter &rhs) |
This is disabled. | |
Private Attributes | |
CubeIoHandler * | m_ioHandler |
The IO Handler instance to put the buffers into. | |
QList< Buffer * > * | m_buffersToWrite |
The buffers that need pushed into the IO handler; we own these. | |
QTime * | m_timer |
Used to calculate the lifetime of an instance of this class. | |
This class is designed to handle write() asynchronously.
Only one of these should be running at a time, otherwise race conditions may exist, so this class locks the ioHandler->m_writeThreadMutex appropriately.
This works by doing what write() used to do, but inside of run(), so that it can happen simultaneously. If any read operations occur, they must block until all writes are done.
Definition at line 185 of file CubeIoHandler.h.
Isis::CubeIoHandler::BufferToChunkWriter::BufferToChunkWriter | ( | CubeIoHandler * | ioHandler, |
QList< Buffer * > | buffersToWrite ) |
Create a BufferToChunkWriter which is designed to asynchronously move the given buffers into the cube cache.
This will lock the ioHandler's m_writeThreadMutex.
ioHandler | This is the cube IO handler. It's not const because you should have non-constness on a cube in order to write to it. This does, sometimes, need overridden externally if you are simply flushing the cache and not doing a new write. |
buffersToWrite | The buffers to put into the cube. This takes ownership of the given buffers. |
Definition at line 1865 of file CubeIoHandler.cpp.
References m_buffersToWrite, m_ioHandler, m_timer, and Isis::CubeIoHandler::m_writeThreadMutex.
Isis::CubeIoHandler::BufferToChunkWriter::~BufferToChunkWriter | ( | ) |
We're done writing our buffers into the cube, clean up.
It turns out you can't start the next cache flush from here, so this does not initiate another write cache flush.
Before releasing the lock on the QDataFile, this destructor attempts to correct the ideal cache size to reflect the current run. This tries to bring the cache size to a point where this class lives for a total of 100ms.
Definition at line 1886 of file CubeIoHandler.cpp.
|
private |
This is disabled.
other | Nothing. |
|
private |
This is disabled.
rhs | Nothing. |
void Isis::CubeIoHandler::BufferToChunkWriter::run | ( | ) |
This is the asynchronous computation.
Write the given buffers into the cube synchronously in this thread and delete the buffers when we're done.
Definition at line 1920 of file CubeIoHandler.cpp.
The buffers that need pushed into the IO handler; we own these.
Definition at line 210 of file CubeIoHandler.h.
Referenced by BufferToChunkWriter().
|
private |
The IO Handler instance to put the buffers into.
Definition at line 208 of file CubeIoHandler.h.
Referenced by BufferToChunkWriter().
|
private |
Used to calculate the lifetime of an instance of this class.
Definition at line 212 of file CubeIoHandler.h.
Referenced by BufferToChunkWriter().