diff OrthancServer/main.cpp @ 1741:06addfcd1d4c

OrthancStarted and OrthancStopped events in plugins
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 23 Oct 2015 16:49:17 +0200
parents e2675b37eb01
children d143db00a794
line wrap: on
line diff
--- a/OrthancServer/main.cpp	Thu Oct 22 19:53:51 2015 +0200
+++ b/OrthancServer/main.cpp	Fri Oct 23 16:49:17 2015 +0200
@@ -597,6 +597,13 @@
 {
   LOG(WARNING) << "Orthanc has started";
 
+#if ORTHANC_PLUGINS_ENABLED == 1
+  if (context.HasPlugins())
+  {
+    context.GetPlugins().SignalOrthancStarted();
+  }
+#endif
+
   context.GetLua().Execute("Initialize");
 
   Toolbox::ServerBarrier(restApi.LeaveBarrierFlag());
@@ -604,6 +611,13 @@
 
   context.GetLua().Execute("Finalize");
 
+#if ORTHANC_PLUGINS_ENABLED == 1
+  if (context.HasPlugins())
+  {
+    context.GetPlugins().SignalOrthancStopped();
+  }
+#endif
+
   if (restart)
   {
     LOG(WARNING) << "Reset request received, restarting Orthanc";