Class sdm::Iterator
template <typename TItem typename TItem>
Class List > sdm > Iterator
Common interface to all SDMS Iterators. More...
#include <iterator.hpp>
Inherited by the following classes: sdm::iterator::CombinationIterator, sdm::iterator::FunctionIterator, sdm::iterator::SuperIterator
Public Types
Type | Name |
---|---|
typedef TItem | item_type |
Public Functions
Type | Name |
---|---|
virtual std::shared_ptr< Iterator< TItem > > | copy () const = 0 Copy function. |
virtual bool | operator!= (const std::shared_ptr< Iterator > & other) const = 0 Check if two iterators are differents. |
virtual TItem & | operator* () = 0 Get a reference to the item. |
virtual std::shared_ptr< Iterator< TItem > > | operator+ (number n) const = 0 Get the n-step incremented iterator without modifying the current iterator. |
virtual std::shared_ptr< Iterator > | operator++ () = 0 Increment the iterator. |
virtual std::shared_ptr< Iterator< TItem > > | operator+= (number n) = 0 Increment the iterator of n steps. |
virtual TItem * | operator-> () = 0 Get the address of the item. |
virtual bool | operator== (const std::shared_ptr< Iterator > & other) const = 0 Check if two iterators are equals. This function is used to check the end. |
virtual | ~Iterator () |
Detailed Description
Iterators in SDMS are different to std iterators. The usage is similar but SDMS iterators can be seen as super iterators. Indeed, they usually are kind of iterator over iterator. The advantage of this hierarchy in SDMS iterators is that we can use super iterators over other super iterators and without care about the type of sub-iterators.
Template parameters:
TItem
the type of value we iterate over.
Public Types Documentation
typedef item_type
using sdm::Iterator< TItem >::item_type = TItem;
Public Functions Documentation
function copy
virtual std::shared_ptr< Iterator < TItem > > sdm::Iterator::copy () const = 0
Returns:
the copied iterator
function operator!=
virtual bool sdm::Iterator::operator!= (
const std::shared_ptr< Iterator > & other
) const = 0
function operator*
virtual TItem & sdm::Iterator::operator* () = 0
Returns:
TItem& the item
function operator+
virtual std::shared_ptr< Iterator < TItem > > sdm::Iterator::operator+ (
number n
) const = 0
Parameters:
n
the number of step
Returns:
the n-step incremented copy iterator
function operator++
virtual std::shared_ptr< Iterator > sdm::Iterator::operator++ () = 0
Returns:
the incremented iterator
function operator+=
virtual std::shared_ptr< Iterator < TItem > > sdm::Iterator::operator+= (
number n
) = 0
Parameters:
n
the number of step
Returns:
the n-step incremented iterator
function operator->
virtual TItem * sdm::Iterator::operator-> () = 0
Returns:
TItem* the address of the item
function operator==
virtual bool sdm::Iterator::operator== (
const std::shared_ptr< Iterator > & other
) const = 0
function ~Iterator
inline virtual sdm::Iterator::~Iterator ()
Friends Documentation
friend operator!=
inline friend bool sdm::Iterator::operator!= (
const std::shared_ptr< Iterator > & iterator1,
const std::shared_ptr< Iterator > & iterator2
)
friend operator*
inline friend TItem & sdm::Iterator::operator* (
const std::shared_ptr< Iterator > & iterator
)
friend operator++
inline friend std::shared_ptr< Iterator > sdm::Iterator::operator++ (
const std::shared_ptr< Iterator > & iterator
)
friend operator==
inline friend bool sdm::Iterator::operator== (
const std::shared_ptr< Iterator > & iterator1,
const std::shared_ptr< Iterator > & iterator2
)
The documentation for this class was generated from the following file src/sdm/utils/struct/iterator.hpp