summaryrefslogtreecommitdiffstats
path: root/include/ixion/address_iterator.hpp
blob: 9250444e5b82bfefc2f7718f5e9110d21a38afac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

#ifndef INCLUDED_IXION_ADDRESS_ITERATOR_HPP
#define INCLUDED_IXION_ADDRESS_ITERATOR_HPP

#include "types.hpp"

#include <memory>

namespace ixion {

struct abs_range_t;
struct abs_address_t;

class IXION_DLLPUBLIC abs_address_iterator
{
    struct impl;
    std::unique_ptr<impl> mp_impl;

public:
    class IXION_DLLPUBLIC const_iterator
    {
        friend class abs_address_iterator;

        struct impl_node;
        std::unique_ptr<impl_node> mp_impl;

        const_iterator(const abs_range_t& range, rc_direction_t dir, bool end);
    public:
        using value_type = abs_address_t;

        const_iterator();
        const_iterator(const const_iterator& r);
        const_iterator(const_iterator&& r);
        ~const_iterator();

        const_iterator& operator++();
        const_iterator operator++(int);
        const_iterator& operator--();
        const_iterator operator--(int);

        const value_type& operator*() const;
        const value_type* operator->() const;

        bool operator== (const const_iterator& r) const;
        bool operator!= (const const_iterator& r) const;
    };

    abs_address_iterator(const abs_range_t& range, rc_direction_t dir);
    ~abs_address_iterator();

    const_iterator begin() const;
    const_iterator end() const;
    const_iterator cbegin() const;
    const_iterator cend() const;
};

}

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */