Renamed NodeIterator into ListIterator

This commit is contained in:
Benoit Blanchon
2014-11-05 13:12:20 +01:00
parent 64b4e15ce6
commit 8138c64116
3 changed files with 15 additions and 15 deletions

View File

@@ -0,0 +1,37 @@
// Copyright Benoit Blanchon 2014
// MIT License
//
// Arduino JSON library
// https://github.com/bblanchon/ArduinoJson
#pragma once
namespace ArduinoJson {
namespace Internals {
template <typename T>
class ListConstIterator {
public:
explicit ListConstIterator(const Node<T> *node = NULL) : _node(node) {}
const T &operator*() const { return _node->content; }
const T *operator->() { return &_node->content; }
bool operator==(const ListConstIterator<T> &other) const {
return _node == other._node;
}
bool operator!=(const ListConstIterator<T> &other) const {
return _node != other._node;
}
ListConstIterator<T> &operator++() {
if (_node) _node = _node->next;
return *this;
}
private:
const Node<T> *_node;
};
}
}