--- a/src/DataTypeReaderBase.h Mon Aug 27 00:06:14 2018 +0200
+++ b/src/DataTypeReaderBase.h Mon Sep 03 23:40:12 2018 +0200
@@ -1,6 +1,7 @@
#pragma once
#include <string>
+#include <functional>
#include "../include/relpipe/reader/TypeId.h"
#include "../include/relpipe/reader/typedefs.h"
@@ -24,6 +25,8 @@
};
/**
+ * TODO: delete, use handler?
+ *
* @param input input stream, should be at position where the value is to be read; the stream will not be closed afred reading
* @return read value in form of the string representation of given data type.
* E.g. integer 123 is returned as a character string "123",
@@ -33,6 +36,22 @@
virtual string_t readString(std::istream &input) = 0;
/**
+ * The value is read from the input and then passed to the handler.
+ *
+ * @param input
+ * @param handler
+ */
+ virtual void read(std::istream &input, std::function<void(const void *, const std::type_info&) > handler) = 0;
+
+ /**
+ * TODO: documentation
+ *
+ * @param input
+ * @param handler
+ */
+ virtual void read(std::istream &input, std::function<void(const string_t&, const void *, const std::type_info&) > handler) = 0;
+
+ /**
* @param dataType data type code as defined in DDP L0
* @return whether this class supports conversions of this type
*/