diff options
author | Sebastian Geerken <devnull@localhost> | 2013-03-05 00:27:05 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2013-03-05 00:27:05 +0100 |
commit | 49ad0b5252190ffbfb4511131af2032f7f341a60 (patch) | |
tree | d2de69d360e2feff519835cc1fef0d8b3217afc1 /lout/container.hh | |
parent | 0128efee08d42bd4efa1fda3bc12664b216712ae (diff) |
Implemented iterators for Vector.
Diffstat (limited to 'lout/container.hh')
-rw-r--r-- | lout/container.hh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lout/container.hh b/lout/container.hh index f1008e82..10139211 100644 --- a/lout/container.hh +++ b/lout/container.hh @@ -102,11 +102,25 @@ public: */ class Vector: public Collection { + friend class VectorIterator; + private: object::Object **array; int numAlloc, numElements; bool ownerOfObjects; + class VectorIterator: public AbstractIterator + { + private: + Vector *vector; + int index; + + public: + VectorIterator(Vector *vector) { this->vector = vector; index = -1; } + bool hasNext(); + Object *getNext(); + }; + protected: AbstractIterator* createIterator(); |