struct
OutputChunk
{ ... };
A chunk of output data.
Data producer creates OutputChunks and adds them to the end output queue. Once control flow leaves the producer code, it is considered that chunk of data is final and can not be changed; to underline this fact |next| is a const-pointer.
Data consumer removes OutputChunks from the beginning of the output queue. It is possible to consume OutputChunks partially, by updating |next| and |len|.
There are 2 types of output chunks:
- owning: actual data is stored in |buffer| field; producer fills data after the instance it created; it is legal to reduce |len| to show that not all the capacity of |buffer| is used
- non-owning: represents the data stored (owned) somewhere else