76
increasing, until releaseRows is called to release some of the read
data rows. Therefore, it is safe to save the value returned by
getRowsReady, and then process that many rows, without calling it
again to check.
Note that different
CNKBufReader objects associated with the same
CNKBuf may have different numbers of rows ready at any given time.
They will all read the same series of data rows, but one
CNKBufReader
may read it in different chunk sizes than another.
CNKBufReader::
virtual int getEOF();
A CNKProc writing a stream of data into a CNKBuf can set an EOF flag
after it has written all of the data to the
CNKBuf that it ever will, to
terminate the series of data rows.
getEOF() returns true (non-zero) if
the current available chunk includes the end of the data. This is still
meaningful when reading the data in a random access mode: that
getEOF() returns true (non-zero) if and only if the current chunk
defined by {
getChunkPosition(), getRowsReady()} contains the end
of the data.
CNKBufReader::
virtual INT64 getTotalNumRows();
If the CNKBuf knows the total number of rows in its data set (it has
reached the
EOF of a sequential stream, or it has a backing file), then
this method returns the total number of rows. If it doesn't know this
information, it returns
-1.
CNKBufReader::
virtual int isReady();
isReady returns true (non-zero) if the CNKBuf is ready to be read.
Normally, this is
true if getRowsReady() is greater than or equal to
getRequestRows(). It also returns true if getEOF() is true, since the
CNKBuf is as ready as it ever will be: it will never have any more rows
available. A
CNKProc calling isReady should check for this case.
isReady() will always return false (zero) if the error string of the
CNKBuf is not NULL: in this case, the CNKProc should not try accessing
the row data.
CNKBufReader::
Komentarze do niniejszej Instrukcji