Remove `HasNext()` interface form C++ reader
Created by: JiayiFeng
In our current design, a C++ reader has an interface named HasNext()
, which is used to indicate whether the next batch data exists.
However, this design has at least two issues:
-
There is no method to force users to invoke
HasNext()
in advance before invokingReadNext()
. We still need some mechanisms inReadNext()
to deal with the EOF status. -
We are using a CSP channel as readers' double buffers. But CSP channel has no interface to check whether it is empty, so
HasNext()
is hard to implement on readers with a double buffer.
So I think the HasNext()
is redundant. We can remove it and return an empty vector<LoDTensor>
in ReadNext()
to indicate it's the end of a file.