|
resonance 1.0.1
|
Input half of the byte stream interface. More...
#include <ibstream.h>

Public Member Functions | |
| virtual IBStream & | Read (void *pDest, int nSize)=0 |
| Move nSize bytes into pDest. | |
| virtual IBStream & | Seek (int nOffset, int nWhence)=0 |
| Move the read position. | |
| virtual int | Tell ()=0 |
| Report the read position. | |
| virtual int | Eof ()=0 |
| Test whether the read position has arrived at the end of the data. | |
| virtual int | Fail ()=0 |
| Test whether a transfer has failed. | |
| virtual IBStream & | ReadLE (void *pDest, int nSize) |
| Move nSize bytes into pDest through the virtual Read(). | |
| virtual IBStream & | Flush ()=0 |
| Service the underlying transport. | |
| virtual | ~IBStream () |
| Close the stream. | |
Input half of the byte stream interface.
Its RTTI descriptor is at 0x0086f5e0. It has no base. The class has no data member. The object is four bytes of vtable pointer, and every field belongs to a subclass. The descriptor does not emit a standalone accessor, because each derived accessor builds it inline before its own.
Three implementations are attested. IBFileStream derives from this class alone, while IOBStream and IOBPreallocMemStream derive from this class at offset 0 and from OBStream at offset 4. Every vtable in the family places these eight slots first, in the declaration order below, so the recovery is complete rather than partial. IBFileStream's table ends at slot 8, which is what fixes the count.
ReadLE() is the one slot with a shared base body. All three implementations retain it, and it does nothing beyond dispatching Read(). The two entry points are therefore interchangeable on this target.
Fail() is declared with the same signature on OBStream. A class deriving from both therefore overrides the two with one body, which is what IOBPreallocMemStream and IOBStream do.
|
inlinevirtual |
Close the stream.
Vtable slot 8, which is the last of the interface rather than the first, because the destructor is declared after the transfer virtuals. Every implementation supplies a body and none calls a base body, so the body here is empty and was inlined.
|
pure virtual |
Move nSize bytes into pDest.
Vtable slot 1. A short transfer is clamped rather than reported through the return value.
| pDest | The destination buffer. |
| nSize | The number of bytes to move. |
Implemented in IBFileStream, IOBMemStream, and IOBPreallocMemStream.
|
pure virtual |
Move the read position.
Vtable slot 2. An origin outside 0 to 2 returns with no change.
| nOffset | The signed distance to move. |
| nWhence | The origin, one of the StreamSeekOrigin values. |
Implemented in IBFileStream, IOBMemStream, and IOBPreallocMemStream.
|
pure virtual |
Report the read position.
Vtable slot 3.
Implemented in IBFileStream, IOBMemStream, and IOBPreallocMemStream.
|
pure virtual |
Test whether the read position has arrived at the end of the data.
Vtable slot 4.
Implemented in IBFileStream, IOBMemStream, and IOBPreallocMemStream.
|
pure virtual |
Test whether a transfer has failed.
Vtable slot 5.
Implemented in IBFileStream, IOBMemStream, and IOBPreallocMemStream.
|
virtual |
Move nSize bytes into pDest through the virtual Read().
Vtable slot 6. One shared body serves all three implementations and none overrides it. The body does not swap bytes.
| pDest | The destination buffer. |
| nSize | The number of bytes to move. |
|
pure virtual |
Service the underlying transport.
Vtable slot 7. Every implementation returns the stream with no effect, and each supplies its own trivial body rather than sharing one, which is why the slot is pure here. The title is inferred from the position and from the shape. OBStream declares a separate slot with the same shape, and the two cannot share a title, because the return types differ.
Implemented in IBFileStream, IOBMemStream, and IOBPreallocMemStream.