Turi Create  4.0
turi::sframe_iterator Class Reference

#include <core/storage/sframe_data/sframe_reader.hpp>

Public Member Functions

 sframe_iterator (const std::vector< std::shared_ptr< sarray_reader< flexible_type > > > &data, size_t segmentid, bool is_begin_iterator)
 
sframe_iteratoroperator++ ()
 
bool operator== (const sframe_iterator &other) const
 
bool operator!= (const sframe_iterator &other) const
 
const value_type & operator* () const
 
const value_type * operator-> () const
 
int operator- (const sframe_iterator &other) const
 

Detailed Description

A input iterator over an SFrame.

The sframe_iterator provides a simple input iterator (like forward iterator, but one pass. i.e. increment of one, invalidates all other copies.) over a segment of an sframe. It essentially exposes a column of vectors, where each vector is a row in a table.

Since this class wraps several sarray_iterators, it inherits their guarantees, and is thus an input iterator.

Definition at line 43 of file sframe_reader.hpp.

Constructor & Destructor Documentation

◆ sframe_iterator()

turi::sframe_iterator::sframe_iterator ( const std::vector< std::shared_ptr< sarray_reader< flexible_type > > > &  data,
size_t  segmentid,
bool  is_begin_iterator 
)
inline

Constructs an iterator from the underlying data structure of an SFrame

Parameters
dataThe "SFrame" to iterate over
segmentidThe segment to read. Must be a valid segment.
is_begin_iteratorIf true, constructs an iterator pointing to the first row of the given segment If false, constructs an iterator pointing to one row past the end of the given segment

Definition at line 64 of file sframe_reader.hpp.

Member Function Documentation

◆ operator!=()

bool turi::sframe_iterator::operator!= ( const sframe_iterator other) const
inline

Returns true if iterators are different (different SFrame, different segment, or different position)

Definition at line 140 of file sframe_reader.hpp.

◆ operator*()

const value_type& turi::sframe_iterator::operator* ( ) const
inline

Returns the current element. Value will be invalid if the iterator is past the end of the sarray (points to end)

Definition at line 150 of file sframe_reader.hpp.

◆ operator++()

sframe_iterator& turi::sframe_iterator::operator++ ( )
inline

Advances the iterator to the next row of the segment

Definition at line 94 of file sframe_reader.hpp.

◆ operator-()

int turi::sframe_iterator::operator- ( const sframe_iterator other) const
inline

Returns the distance between two iterators. Both iterators must be from the same segment of the same sframe, otherwise result is undefined.

Definition at line 170 of file sframe_reader.hpp.

◆ operator->()

const value_type* turi::sframe_iterator::operator-> ( ) const
inline

Returns a pointer to the current element. Value will be invalid if iterator == end.

Definition at line 161 of file sframe_reader.hpp.

◆ operator==()

bool turi::sframe_iterator::operator== ( const sframe_iterator other) const
inline

Returns true if iterators are identical (points to the same SFrame, in the same segment, at the same position)

Definition at line 130 of file sframe_reader.hpp.


The documentation for this class was generated from the following file: