diff Core/DicomNetworking/DicomServer.cpp @ 3818:4f78da5613a1 c-get

Add C-GET SCP support
author Stacy Loesch <stacy.loesch@varian.com>
date Fri, 27 Mar 2020 10:06:58 -0400
parents 56f2397f027a
children 7f296ae25039
line wrap: on
line diff
--- a/Core/DicomNetworking/DicomServer.cpp	Wed Apr 08 14:01:37 2020 +0200
+++ b/Core/DicomNetworking/DicomServer.cpp	Fri Mar 27 10:06:58 2020 -0400
@@ -92,6 +92,7 @@
     modalities_ = NULL;
     findRequestHandlerFactory_ = NULL;
     moveRequestHandlerFactory_ = NULL;
+    getRequestHandlerFactory_ = NULL;
     storeRequestHandlerFactory_ = NULL;
     worklistRequestHandlerFactory_ = NULL;
     storageCommitmentFactory_ = NULL;
@@ -244,6 +245,29 @@
     }
   }
 
+  void DicomServer::SetGetRequestHandlerFactory(IGetRequestHandlerFactory& factory)
+  {
+    Stop();
+    getRequestHandlerFactory_ = &factory;
+  }
+
+  bool DicomServer::HasGetRequestHandlerFactory() const
+  {
+    return (getRequestHandlerFactory_ != NULL);
+  }
+
+  IGetRequestHandlerFactory& DicomServer::GetGetRequestHandlerFactory() const
+  {
+    if (HasGetRequestHandlerFactory())
+    {
+      return *getRequestHandlerFactory_;
+    }
+    else
+    {
+      throw OrthancException(ErrorCode_NoCGetHandler);
+    }
+  }
+
   void DicomServer::SetStoreRequestHandlerFactory(IStoreRequestHandlerFactory& factory)
   {
     Stop();