#include <GContainers.h>
Public Attributes | |
int | Next |
int | Used |
int | Size |
Initially a block starts out as completely type 3 bytes, just garbage data waiting to be written to. Then something writes into the pipe and bytes are stored into this free space, and the 'Used' variable is set to show how much of the available buffer is used. At this point we have type 2 and type 3 bytes in the block. The buffer can fill up completely in which case Used == Size and there are no type 3 bytes left. Also at some point something can start reading bytes out of the block which causes the 'Next' value to be increased, at which point the block starts with 'Next' bytes of type 1. Crystal?
Number of bytes in this block that have been read Type 1 or 'read' bytes are in [0,Next-1].
Referenced by GBytePipe::Peek(), GStringPipe::Pop(), GBytePipe::Read(), GBytePipe::StringAt(), and GBytePipe::Write().
Number of bytes that are used in this block include read bytes. Type 2 or 'used' bytes are in [Next,Used-1].
Referenced by GStringPipe::Pop(), GBytePipe::Read(), GBytePipe::StringAt(), and GBytePipe::Write().
Total size of the memory block Type 3 or 'unused' bytes are in [Used,Size-1].
Referenced by GBytePipe::Peek(), and GBytePipe::Write().