Flush method

Project: I/O Utility Classes

Unit: PJPipeFilters

Class: TPJPipeFilter

Applies to: ~>1.0

procedure Flush;

Description

Flushes any unprocessed data.

Remarks

Flush is called automatically when the filter object is destroyed.

Actions resulting from calling this method depend on the implementation of descendant classes.

Implementers of new filter classes should note that the required actions must be implemented in the override of the abstract DoFlush method.

Implementations should ensure that multiple calls to Flush between pipe reads have the same effect as calling the method once. For example, assuming that F is an instance of a TPJPipeFilter concrete descendant class, this code:

...
F.ReadPipe;
F.Flush;
F.Flush;
F.ReadPipe;
F.Flush;
F.Free; // calls.F.Flush;
...

should act the same as

...
F.ReadPipe;
F.Flush;
F.ReadPipe;
F.Free;  // calls F.Flush;
...

In some cases this method may legitimately do nothing.