-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathiterator.h
More file actions
49 lines (41 loc) · 862 Bytes
/
Copy pathiterator.h
File metadata and controls
49 lines (41 loc) · 862 Bytes
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
#pragma once
#include "simpleaudio.h"
#include <map>
#include <vector>
using std::map;
using std::vector;
namespace iterator
{
template<typename T>
class IIteratorProfile
{
public:
virtual void get(unsigned int index, T *pT) = 0;
virtual unsigned int count() = 0;
};
template<typename T>
class Iterator : public simpleaudio::IIterator<T>
{
private:
IIteratorProfile<T> * itProf;
unsigned int index;
unsigned int count;
public:
Iterator(IIteratorProfile<T> *itProf);
~Iterator();
void next(T *pT);
bool hasNext();
};
template<typename T, typename U>
class MapValueIteratorProfile : public iterator::IIteratorProfile<U>
{
public:
MapValueIteratorProfile(map<T, U> *pUs);
~MapValueIteratorProfile();
void get(unsigned int index, U *pU);
unsigned int count();
private:
vector<U> *pUs;
};
}
#include "iterator.hpp"