/** * ValueIterator.cpp * * Implementation of the value iterator * * @author Emiel Bruijntjes * @copyright 2014 Copernica BV */ #include "includes.h" /** * Set up namespace */ namespace Php { /** * Constructor * @param impl Implementation iterator */ ValueIterator::ValueIterator(ValueIteratorImpl *impl) : _impl(impl) {} /** * Copy constructor * @param that * @param tsrm_ls */ ValueIterator::ValueIterator(const ValueIterator &that) : _impl(that._impl->clone()) {} /** * Destructor */ ValueIterator::~ValueIterator() = default; /** * Increment position * @return ValueIterator */ ValueIterator &ValueIterator::operator++() { // increment implementation _impl->increment(); // done return *this; } /** * Decrement position * @return ValueIterator */ ValueIterator &ValueIterator::operator--() { // decrement implementation _impl->decrement(); // done return *this; } /** * Compare with other iterator * @param that * @return bool */ bool ValueIterator::operator==(const ValueIterator &that) const { return _impl->equals(that._impl.get()); } /** * Compare with other iterator * @param that * @return bool */ bool ValueIterator::operator!=(const ValueIterator &that) const { return !_impl->equals(that._impl.get()); } /** * Derefecence, this returns a std::pair with the current key and value * @return std::pair */ const std::pair &ValueIterator::operator*() const { return _impl->current(); } /** * Dereference, this returns a std::pair with the current key and value * @return std::pair */ const std::pair *ValueIterator::operator->() const { return &_impl->current(); } /** * End namespace */ }