diff Deprecated/Platforms/Wasm/WasmDelayedCallExecutor.cpp @ 1400:419d0320c344

moved Platforms into Deprecated
author Alain Mazy <alain@mazy.be>
date Wed, 29 Apr 2020 20:45:14 +0200
parents Platforms/Wasm/WasmDelayedCallExecutor.cpp@4f2416d519b4
children 828a9b4ee1b7
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Deprecated/Platforms/Wasm/WasmDelayedCallExecutor.cpp	Wed Apr 29 20:45:14 2020 +0200
@@ -0,0 +1,46 @@
+#include "WasmDelayedCallExecutor.h"
+#include "json/value.h"
+#include "json/writer.h"
+#include <emscripten/emscripten.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+  extern void WasmDelayedCallExecutor_Schedule(void* callable,
+                                      unsigned int timeoutInMs
+                                      /*void* payload*/);
+
+  void EMSCRIPTEN_KEEPALIVE WasmDelayedCallExecutor_ExecuteCallback(void* callable
+                                                       //void* payload
+                                                       )
+  {
+    if (callable == NULL)
+    {
+      throw;
+    }
+    else
+    {
+      reinterpret_cast<OrthancStone::MessageHandler<Deprecated::IDelayedCallExecutor::TimeoutMessage>*>(callable)->
+        Apply(Deprecated::IDelayedCallExecutor::TimeoutMessage()); // uri, reinterpret_cast<Orthanc::IDynamicObject*>(payload)));
+    }
+  }
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+namespace Deprecated
+{
+  OrthancStone::MessageBroker* WasmDelayedCallExecutor::broker_ = NULL;
+
+
+  void WasmDelayedCallExecutor::Schedule(OrthancStone::MessageHandler<IDelayedCallExecutor::TimeoutMessage>* callback,
+                         unsigned int timeoutInMs)
+  {
+    WasmDelayedCallExecutor_Schedule(callback, timeoutInMs);
+  }
+}