WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
BaseIterator.h
Go to the documentation of this file.
1#pragma once
2
3#include <vector>
4
7template <class ItemType>
9{
10public:
12 virtual ~BaseIterator();
13
15 void begin();
16
18 bool end();
19
21 void operator++(int);
22
24 int size() { return m_items.size(); }
25
26protected:
27 std::vector<ItemType*> m_items;
28 typename std::vector<ItemType*>::iterator m_internalIt;
29};
30
31template <class ItemType>
33{
34 m_internalIt = m_items.begin();
35}
36
37template <class ItemType>
41
42template <class ItemType>
44{
45 m_internalIt = m_items.begin();
46}
47
48template <class ItemType>
50{
51 return m_items.end();
52}
53
54template <class ItemType>
56{
57 ++m_internalIt;
58}
Simple forward iterator over a collection of pointers.
Definition BaseIterator.h:9
void begin()
Reset the iterator to the first element.
bool end()
Check whether the iterator has reached the end.
std::vector< ItemType * >::iterator m_internalIt
Current position.
void operator++(int)
Advance the iterator (postfix).
int size()
Return the number of items.
virtual ~BaseIterator()
std::vector< ItemType * > m_items
Stored item pointers.