-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathPyTupleIterator.h
47 lines (37 loc) · 1.15 KB
/
PyTupleIterator.h
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
/*
* File: PyTupleIterator.h
* Author: Kent D. Lee
* (c) 2013
* Created on March 7, 2013, 11:37 PM
*
* License:
* Please read the LICENSE file in this distribution for details regarding
* the licensing of this code. This code is freely available for educational
* use. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
*
* Description:
* The class that implements iteration over a tuple. As with other iterators,
* calling the __iter__ magic method on an string iterator as shown below has
* no effect other than to return an alias to itself. See the PyStrIterator.h
* file for a further discussion of how iterators work.
*/
#ifndef PYTUPLEITERATOR_H
#define PYTUPLEITERATOR_H
#include "PyObject.h"
#include "PyType.h"
#include "PyTuple.h"
#include <string>
using namespace std;
class PyTupleIterator : public PyObject {
public:
PyTupleIterator(PyTuple* lst);
virtual ~PyTupleIterator();
PyType* getType();
string toString();
PyObject* __iter__(vector<PyObject*>* args);
PyObject* __next__(vector<PyObject*>* args);
private:
PyTuple* lst;
int index;
};
#endif /* PYTUPLEITERATOR_H */