Turi Create  4.0
turi::sarray_iterator< T > Class Template Reference

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

Public Member Functions

 sarray_iterator ()
 
 sarray_iterator (const sarray_iterator &other)=default
 Default copy constructor.
 
sarray_iteratoroperator= (const sarray_iterator &other)=default
 Default assignment operator.
 
 sarray_iterator (sarray_reader_buffer< T > *reader, size_t segmentid, bool is_start_iterator)
 
sarray_iteratoroperator++ ()
 
void operator++ (int)
 
bool operator== (const sarray_iterator &other) const
 
bool operator!= (const sarray_iterator &other) const
 
const value_type & operator* () const
 
value_type & operator* ()
 
int operator- (const sarray_iterator &other) const
 

Detailed Description

template<typename T>
class turi::sarray_iterator< T >

Implements a simple input iterator over an sarray.

The sarray_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 sarray.

Definition at line 42 of file sarray_reader.hpp.

Constructor & Destructor Documentation

◆ sarray_iterator() [1/2]

template<typename T>
turi::sarray_iterator< T >::sarray_iterator ( )
inline

Default constructor. Makes an iterator which points nowhere. Use of this iterator will produce undefined results.

Definition at line 55 of file sarray_reader.hpp.

◆ sarray_iterator() [2/2]

template<typename T>
turi::sarray_iterator< T >::sarray_iterator ( sarray_reader_buffer< T > *  reader,
size_t  segmentid,
bool  is_start_iterator 
)
inline

Constructs an iterator from an input archive. Creates a start iterator to the segment.

Parameters
readerThe file format reader to use
segmentidThe segment to read. Must be a valid segment
is_start_iteratorIf true, creates a start iterator to the segment. If false, creates an end iterator to the segment.

Definition at line 74 of file sarray_reader.hpp.

Member Function Documentation

◆ operator!=()

template<typename T>
bool turi::sarray_iterator< T >::operator!= ( const sarray_iterator< T > &  other) const
inline

Returns true if the iterators are different (points to different elements, or in different sarrays)

Definition at line 127 of file sarray_reader.hpp.

◆ operator*() [1/2]

template<typename T>
const value_type& turi::sarray_iterator< T >::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 135 of file sarray_reader.hpp.

◆ operator*() [2/2]

template<typename T>
value_type& turi::sarray_iterator< T >::operator* ( )
inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 142 of file sarray_reader.hpp.

◆ operator++() [1/2]

template<typename T>
sarray_iterator& turi::sarray_iterator< T >::operator++ ( )
inline

Advances the iterator to the next element

Definition at line 94 of file sarray_reader.hpp.

◆ operator++() [2/2]

template<typename T>
void turi::sarray_iterator< T >::operator++ ( int  )
inline

Equivalent to other operator++ for input iterators

Definition at line 108 of file sarray_reader.hpp.

◆ operator-()

template<typename T>
int turi::sarray_iterator< T >::operator- ( const sarray_iterator< T > &  other) const
inline

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

Definition at line 150 of file sarray_reader.hpp.

◆ operator==()

template<typename T>
bool turi::sarray_iterator< T >::operator== ( const sarray_iterator< T > &  other) const
inline

Returns true if the iterators are identical (points to the same element in the same sarray).

Definition at line 117 of file sarray_reader.hpp.


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