Class ConstResultIterator

Synopsis

#include <orm_lib/inc/drogon/orm/ResultIterator.h>

class ConstResultIterator
    : public std::iterator<std::random_access_iterator_tag,
                           const Row,
                           Result::DifferenceType,
                           ConstResultIterator,
                           Row>,
      protected Row

Description

No description yet.

Inheritance

Ancestors: Row, std::iterator< std::random_access_iterator_tag, const Row, Result::DifferenceType, ConstResultIterator, Row >

Decsendents: ConstReverseResultIterator

Methods

ConstResultIterator
operator!=
operator*
operator++
operator+=
operator--
operator-=
operator->
operator<
operator<=
operator==
operator>
operator>=

Source

Lines 26-107 in orm_lib/inc/drogon/orm/ResultIterator.h. Line 33 in orm_lib/inc/drogon/orm/ResultIterator.h.

class ConstResultIterator
    : public std::iterator<std::random_access_iterator_tag,
                           const Row,
                           Result::DifferenceType,
                           ConstResultIterator,
                           Row>,
      protected Row
{
  public:
    using pointer = const Row *;
    using reference = const Row &;
    using value_type = const Row;
    using size_type = Result::SizeType;
    using difference_type = Result::DifferenceType;
    // ConstResultIterator(const Row &t) noexcept : Row(t) {}

    pointer operator->()
    {
        return this;
    }
    reference operator*()
    {
        return *this;
    }

    ConstResultIterator operator++(int);
    ConstResultIterator &operator++()
    {
        ++index_;
        return *this;
    }
    ConstResultIterator operator--(int);
    ConstResultIterator &operator--()
    {
        --index_;
        return *this;
    }
    ConstResultIterator &operator+=(difference_type i)
    {
        index_ += i;
        return *this;
    }
    ConstResultIterator &operator-=(difference_type i)
    {
        index_ -= i;
        return *this;
    }

    bool operator==(const ConstResultIterator &other) const
    {
        return index_ == other.index_;
    }
    bool operator!=(const ConstResultIterator &other) const
    {
        return index_ != other.index_;
    }
    bool operator>(const ConstResultIterator &other) const
    {
        return index_ > other.index_;
    }
    bool operator<(const ConstResultIterator &other) const
    {
        return index_ < other.index_;
    }
    bool operator>=(const ConstResultIterator &other) const
    {
        return index_ >= other.index_;
    }
    bool operator<=(const ConstResultIterator &other) const
    {
        return index_ <= other.index_;
    }
    ConstResultIterator(const ConstResultIterator &) noexcept = default;
    ConstResultIterator(ConstResultIterator &&) noexcept = default;

  private:
    friend class Result;
    ConstResultIterator(const Result &r, SizeType index) noexcept
        : Row(r, index)
    {
    }
};





Add Discussion as Guest

Log in to DocsForge