streamlet examples: common functions in C/C++: check supported version v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Mon, 27 Jan 2020 00:43:39 +0100
branchv_0
changeset 66 8a8b6434e4bb
parent 65 6944a03fb883
child 67 0766d298eb1c
streamlet examples: common functions in C/C++: check supported version
streamlet-examples/streamlet-common.h
--- a/streamlet-examples/streamlet-common.h	Mon Jan 27 00:29:56 2020 +0100
+++ b/streamlet-examples/streamlet-common.h	Mon Jan 27 00:43:39 2020 +0100
@@ -155,8 +155,8 @@
 	}
 
 	virtual void processWaitingForVersion(Message& m) {
-		// TODO: check that 1 is supported
-		write({S::VERSION_ACCEPTED, L"1"});
+		for (std::wstring v : versionsSupported) if (v == L"1") return write({S::VERSION_ACCEPTED, L"1"});
+		write({S::STREAMLET_ERROR, L"INCOMPATIBLE_VERSION", L"Only version 1 is supported by this streamlet."});
 	}
 
 	virtual void processRelationStart(Message& m) {