AsyncIOItem
Engine/source/platform/threads/threadPoolAsyncIO.h
Abstract superclass of async I/O work items.
Public Types
Protected Attributes
Buffer keeping/receiving the data elements.
Number of elements to read from/write to the stream.
Offset in "mBuffer" from where to read/where to start writing to.
Offset in stream from where to read/where to write to.
The stream to read from/write to.
Protected Functions
Public Functions
AsyncIOItem(StreamType * stream, BufferType & buffer, U32 offsetInBuffer, U32 numElements, OffsetType offsetInStream, bool takeOwnershipOfBuffer, ThreadContext * context)
Construct a read item on "stream" that stores data into the given "buffer".
AsyncIOItem(StreamType * stream, U32 numElements, OffsetType offsetInStream, ThreadContext * context)
If the stream uses implicit positioning, then the supplied "offsetInStream" is meaningless and ignored.
Return the data buffer being written to/read from.
Return the number of elements involved in the transfer.
Return the position in the data buffer at which to start the transfer.
Return the position in the stream at which to start the transfer.
Return the stream being written to/read from.
Detailed Description
Abstract superclass of async I/O work items.
Supports both offset-based stream I/O as well as I/O on streams with implicit positions. Note that if you use the latter type, make sure that no other thread is messing with the stream at the same time or chaos will ensue.
Parameters:
T | Type of elements being streamed. |
Public Types
typedef RawDataT< ValueType > BufferType
typedef U32 OffsetType
typedef WorkItem Parent
typedef Stream StreamType
typedef T ValueType
Protected Attributes
BufferType mBuffer
Buffer keeping/receiving the data elements.
U32 mNumElements
Number of elements to read from/write to the stream.
U32 mOffsetInBuffer
Offset in "mBuffer" from where to read/where to start writing to.
OffsetType mOffsetInStream
Offset in stream from where to read/where to write to.
note:This is only meaningful if the stream is an offset I/O stream. For a stream that is can do both types of I/O, explicit offsets are preferred and this value is used.
StreamType * mStream
The stream to read from/write to.
Protected Functions
getBufferPtr()
Public Functions
AsyncIOItem(StreamType * stream, BufferType & buffer, U32 offsetInBuffer, U32 numElements, OffsetType offsetInStream, bool takeOwnershipOfBuffer, ThreadContext * context)
Construct a read item on "stream" that stores data into the given "buffer".
AsyncIOItem(StreamType * stream, U32 numElements, OffsetType offsetInStream, ThreadContext * context)
If the stream uses implicit positioning, then the supplied "offsetInStream" is meaningless and ignored.
getBuffer()
Return the data buffer being written to/read from.
note:This may not yet have been allocated.
getNumElements()
Return the number of elements involved in the transfer.
getOffsetInBuffer()
Return the position in the data buffer at which to start the transfer.
getOffsetInStream()
Return the position in the stream at which to start the transfer.
note:Only meaningful for streams that support offset I/O.
getStream()
Return the stream being written to/read from.