class InFilterStream : public Stream
Adapter Stream that glues an input stream with some filtering object, typically of compression/decompression class.
Stream *in
Pointer to input stream that serves as the source of data to be filtered.
Event<const void *, int> Filter
Callback to filter input function.
Gate<> FilterEof
In some cases, there is a logical end of filtered stream before the end of 'real' stream. This Gate serves as signal of such situation.
Event<> End
Callback to filter finalization. This is invoked by InFilterStream when it reaches the end of input stream. It gives chance to the filter to flush any remaining data (to Out).
Gate<> More
Callback used for alternate mode of operation where instead of input stream and filter only single data source is used (e.g. HttpRequest). It should push data through FilterStream::Out method and return true if source of data is still active, false when it reaches the end. False is then interpreted as EOF of InFilterStream.
void Out(const void *ptr, int size)
Method serving as filter output.
Event<> WhenOut
This callback is called whenever Out method is invoked. It is intended for load progress indicators.
template <class F> void Set(Stream& in_, F& filter)
Sets the input stream and filter. Filter must have WhenOut Event which is connected to Out method and Put and End methods that are connected to Filter and End Events.
void SetBufferSize(int size)
Sets the size of internal buffer used to store input data before being filtered.
InFilterStream()
Default constructor.
template <class F> InFilterStream(Stream& in, F& filter)
Equivalent of default constructor followed by Set.
|