summaryrefslogtreecommitdiff
path: root/src/iteratorimpl.h
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-20 16:20:45 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-20 16:20:45 +0100
commitb1f91277a29ddac92479106543ecfd62ff99d152 (patch)
tree55aab26342b34c5d9e661f42077c480d444ef345 /src/iteratorimpl.h
parent6d42a8f99cbe98201a0d52ab276f6929b66cfe4f (diff)
added hashiterator, this is going to be one of the implementation classes for the upcoming value iterator
Diffstat (limited to 'src/iteratorimpl.h')
-rw-r--r--src/iteratorimpl.h52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/iteratorimpl.h b/src/iteratorimpl.h
new file mode 100644
index 0000000..97c59e4
--- /dev/null
+++ b/src/iteratorimpl.h
@@ -0,0 +1,52 @@
+/**
+ * IteratorImpl.h
+ *
+ * Interface that describes what an implementation of an iterator should
+ * look like. This is an internal class that extension developers do not
+ * need.
+ *
+ * @author Emiel Bruijntjes <emiel.bruijntjes@copernica.com>
+ * @copyright 2014 Copernica BV
+ */
+
+/**
+ * Set up namespace
+ */
+namespace Php {
+
+/**
+ * Class definition
+ */
+class IteratorImpl
+{
+ /**
+ * Increment position (pre-increment)
+ * @return bool
+ */
+ virtual bool increment() = 0;
+
+ /**
+ * Decrement position (pre-decrement)
+ * @return bool
+ */
+ virtual bool decrement() = 0;
+
+ /**
+ * Compare with other iterator
+ * @param that
+ * @return bool
+ */
+ virtual bool equals(const IteratorImpl *that) const = 0;
+
+ /**
+ * Derefecence, this returns a std::pair with the current key and value
+ * @return std::pair
+ */
+ virtual const std::pair<Value,Value> &current() const = 0;
+};
+
+/**
+ * End namespace
+ */
+}
+