aboutsummaryrefslogtreecommitdiff
path: root/backend/ListIterator.h
blob: 3d118067dd214019c12ab36ac717a0805558d907 (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
#pragma once

#include "backend/List.h"

#include <stddef.h>

template <typename T>
class List;

template <typename T>
class ListIterator {
public:
	ListIterator(ListLink<T> * & here);

public:
	T & operator * () const;
	ListIterator<T> & operator ++ ();
	bool operator != (const ListIterator<T> &) const;

private:
	ListLink<T> * here = nullptr;
	ListLink<T> * next = nullptr;
};

template <typename T>
class ListRange {
public:
	ListRange(List<T> & list);

public:
	ListIterator<T> begin();
	ListIterator<T> end();
	size_t size() const;

private:
	List<T> & list;
};

#include "ListIterator.hpp"