Component index
Section index | Component streamp |
Search |
Type | Function |
Summary | Extract records out of a byte stream |
Description | streamp uses a fill() functag to read bytes and a process()
functag to extract records (chunks) out of those bytes. It
may combined several small read yielding large records
or large reads, yielding many smaller records.
Records may be of different sizes during the sesssion. The process() functag decides what is a valid record and how long it is. The component is built using the STREAMP object. |
![]() ![]() | int fill (void *buf, int size, bool &end) | |
![]() ![]() | int process (const void *buf, int len, bool &end, bool nomore) |
Loop until there is no bytes left or until one functag request the end of the loop
This is called until there is enough bytes to please the process functag
The functag must check for record. For example, if the function process text line, it will make sure there is an end of line character in the buffer. The function returns the number of bytes used in the buffer or 0 if there were not enough bytes (incomplete record).