Turi Create
4.0
|
#include <core/storage/sframe_data/sarray_reader_buffer.hpp>
Public Member Functions | |
sarray_reader_buffer (std::shared_ptr< typename sarray< T >::reader_type > reader, size_t row_start, size_t row_end, size_t buffer_size=DEFAULT_SARRAY_READER_BUFFER_SIZE) | |
Construct from sarray reader with begin and end row. | |
void | init (std::shared_ptr< typename sarray< T >::reader_type > &reader, size_t row_start, size_t row_end, size_t internal_buffer_size=DEFAULT_SARRAY_READER_BUFFER_SIZE) |
void | init (typename sarray< T >::reader_type *reader_weak, size_t row_start, size_t row_end, size_t internal_buffer_size=DEFAULT_SARRAY_READER_BUFFER_SIZE) |
value_type && | next () |
Return the next element in the reader. More... | |
bool | has_next () |
Return true if the reader has more element. More... | |
std::vector< value_type > & | get_buffer () |
Return the buffer. | |
size_t | size () |
Return the Number of elements between row_start and row_end. | |
void | clear () |
A buffered reader reading from a range of an sarray<T>.
Internally, the reader maintains a vector as buffer, and when reading reaches the end of the buffer, refill the buffer by reading from sarray.
Definition at line 36 of file gl_sarray.hpp.
void turi::sarray_reader_buffer< T >::clear | ( | ) |
Resets the buffer to the initial starting conditions. Reading from the buffer again will start from row_start.
Definition at line 174 of file sarray_reader_buffer.hpp.
bool turi::sarray_reader_buffer< T >::has_next | ( | ) |
Return true if the reader has more element.
Return true if the chunk has remaining element.
Definition at line 160 of file sarray_reader_buffer.hpp.
|
inline |
Construction of a reader_buffer where the reader_buffer owns a reference to the underlying reader.
Definition at line 64 of file sarray_reader_buffer.hpp.
|
inline |
Construction of a reader_buffer where the reader_buffer DOES NOT own a reference to the underlying reader.
Definition at line 87 of file sarray_reader_buffer.hpp.