Develop Biology
The language of life
Iterator.h
Go to the documentation of this file.
1/*
2 * This file is a part of the Biology project by eons LLC.
3 * Biology (aka Develop Biology) is a framework for approaching software
4 * development from a natural sciences perspective.
5 *
6 * Copyright (C) 2022 Séon O'Shannon & eons LLC
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as
10 * published by the Free Software Foundation, either version 3 of the
11 * License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22#pragma once
23
26
27namespace bio {
28
29class Container;
30
39{
40public:
41
50 const Container* container,
51 const Index index = InvalidIndex());
52
56 virtual ~Iterator();
57
61 Index GetIndex() const;
62
68 bool MoveTo(const Index index);
69
73 virtual bool IsAtBeginning() const;
74
78 virtual bool IsAtEnd() const;
79
84 virtual Iterator* Increment();
85
90 virtual Iterator* Decrement();
91
96 virtual ByteStream operator*();
97
102 virtual const ByteStream operator*() const;
103
104protected:
107}; //Iterator class.
108
109} //bio namespace
bool MoveTo(const Index index)
Definition: Iterator.cpp:48
Index m_index
Definition: Iterator.h:106
virtual bool IsAtBeginning() const
Definition: Iterator.cpp:58
virtual ~Iterator()
Definition: Iterator.cpp:38
virtual Iterator * Increment()
Definition: Iterator.cpp:68
Index GetIndex() const
Definition: Iterator.cpp:43
Iterator(const Container *container, const Index index=InvalidIndex())
Definition: Iterator.cpp:27
Container * m_container
Definition: Iterator.h:105
virtual bool IsAtEnd() const
Definition: Iterator.cpp:63
virtual ByteStream operator*()
Definition: Iterator.cpp:95
virtual Iterator * Decrement()
Definition: Iterator.cpp:82
Definition: Cell.h:31
uint32_t Index
Definition: Types.h:57
const Index InvalidIndex()
Definition: Types.cpp:26