tzutrader
A composable C++ backtesting library for trading strategies (experimental)
Loading...
Searching...
No Matches
tzu::ParseIterator< T, Parser > Class Template Reference

#include <streamers.h>

Public Member Functions

 ParseIterator (std::istream *input, bool end=false)
ParseIteratoroperator++ ()
const T & operator* () const
const T * operator-> () const
bool operator== (const ParseIterator &other) const
bool operator!= (const ParseIterator &other) const

Detailed Description

template<typename T, typename Parser>
class tzu::ParseIterator< T, Parser >

An text input iterator that reads lines from a stream and parses them into a specific data type.

Constructor & Destructor Documentation

◆ ParseIterator()

template<typename T, typename Parser>
tzu::ParseIterator< T, Parser >::ParseIterator ( std::istream * input,
bool end = false )
inline

Constructs an iterator that reads from the given input stream. If end is true, constructs an end iterator.

Member Function Documentation

◆ operator!=()

template<typename T, typename Parser>
bool tzu::ParseIterator< T, Parser >::operator!= ( const ParseIterator< T, Parser > & other) const
inline

Compares two iterators for inequality.

◆ operator*()

template<typename T, typename Parser>
const T & tzu::ParseIterator< T, Parser >::operator* ( ) const
inline

Dereferences the iterator to access the current parsed value. The behavior is undefined if the iterator is at the end.

◆ operator++()

template<typename T, typename Parser>
ParseIterator & tzu::ParseIterator< T, Parser >::operator++ ( )
inline

Advances the iterator to the next valid line in the input stream. Lines that fail to parse are skipped. If the end of the stream is reached, sets the end flag.

◆ operator->()

template<typename T, typename Parser>
const T * tzu::ParseIterator< T, Parser >::operator-> ( ) const
inline

Provides pointer-like access to the current parsed value. The behavior is undefined if the iterator is at the end.

◆ operator==()

template<typename T, typename Parser>
bool tzu::ParseIterator< T, Parser >::operator== ( const ParseIterator< T, Parser > & other) const
inline

Compares two iterators for equality. Two iterators are considered equal if they are both end iterators or if they point to the same position in the input stream.


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