changeset 3095:beeeb6096f27 db-changes

removing dependencies upon ServerContext
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 05 Jan 2019 18:22:25 +0100
parents 61da3c9b4121
children d9eb978a1039
files CMakeLists.txt OrthancServer/OrthancFindRequestHandler.cpp OrthancServer/OrthancFindRequestHandler.h OrthancServer/OrthancMoveRequestHandler.cpp OrthancServer/OrthancMoveRequestHandler.h OrthancServer/OrthancRestApi/OrthancRestArchive.cpp OrthancServer/OrthancRestApi/OrthancRestModalities.cpp OrthancServer/ServerContext.cpp OrthancServer/ServerContext.h OrthancServer/ServerIndex.h OrthancServer/ServerJobs/ArchiveJob.cpp OrthancServer/ServerJobs/ArchiveJob.h OrthancServer/ServerJobs/DicomModalityStoreJob.cpp OrthancServer/ServerJobs/DicomModalityStoreJob.h OrthancServer/ServerJobs/DicomMoveScuJob.cpp OrthancServer/ServerJobs/DicomMoveScuJob.h OrthancServer/ServerJobs/MergeStudyJob.cpp OrthancServer/ServerJobs/MergeStudyJob.h OrthancServer/ServerJobs/Operations/DeleteResourceOperation.cpp OrthancServer/ServerJobs/Operations/DeleteResourceOperation.h OrthancServer/ServerJobs/Operations/DicomInstanceOperationValue.cpp OrthancServer/ServerJobs/Operations/DicomInstanceOperationValue.h OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.cpp OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.h OrthancServer/ServerJobs/Operations/SystemCallOperation.cpp OrthancServer/ServerJobs/OrthancJobUnserializer.h OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp OrthancServer/ServerJobs/OrthancPeerStoreJob.h OrthancServer/ServerJobs/ResourceModificationJob.cpp OrthancServer/ServerJobs/ResourceModificationJob.h OrthancServer/ServerJobs/SplitStudyJob.cpp OrthancServer/ServerJobs/SplitStudyJob.h
diffstat 32 files changed, 106 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/CMakeLists.txt	Sat Jan 05 17:52:24 2019 +0100
+++ b/CMakeLists.txt	Sat Jan 05 18:22:25 2019 +0100
@@ -91,6 +91,7 @@
   OrthancServer/ServerJobs/LuaJobManager.cpp
   OrthancServer/ServerJobs/MergeStudyJob.cpp
   OrthancServer/ServerJobs/Operations/DeleteResourceOperation.cpp
+  OrthancServer/ServerJobs/Operations/DicomInstanceOperationValue.cpp
   OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.cpp
   OrthancServer/ServerJobs/Operations/StorePeerOperation.cpp
   OrthancServer/ServerJobs/Operations/StoreScuOperation.cpp
--- a/OrthancServer/OrthancFindRequestHandler.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/OrthancFindRequestHandler.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -40,6 +40,7 @@
 #include "../Core/Lua/LuaFunctionCall.h"
 #include "OrthancConfiguration.h"
 #include "Search/DatabaseLookup.h"
+#include "ServerContext.h"
 #include "ServerToolbox.h"
 
 #include <boost/regex.hpp> 
--- a/OrthancServer/OrthancFindRequestHandler.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/OrthancFindRequestHandler.h	Sat Jan 05 18:22:25 2019 +0100
@@ -34,10 +34,10 @@
 
 #include "../Core/DicomNetworking/IFindRequestHandler.h"
 
-#include "ServerContext.h"
-
 namespace Orthanc
 {
+  class ServerContext;
+  
   class OrthancFindRequestHandler : public IFindRequestHandler
   {
   private:
--- a/OrthancServer/OrthancMoveRequestHandler.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/OrthancMoveRequestHandler.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -34,10 +34,11 @@
 #include "PrecompiledHeadersServer.h"
 #include "OrthancMoveRequestHandler.h"
 
-#include "OrthancConfiguration.h"
 #include "../../Core/DicomParsing/FromDcmtkBridge.h"
 #include "../Core/DicomFormat/DicomArray.h"
 #include "../Core/Logging.h"
+#include "OrthancConfiguration.h"
+#include "ServerContext.h"
 #include "ServerJobs/DicomModalityStoreJob.h"
 
 namespace Orthanc
--- a/OrthancServer/OrthancMoveRequestHandler.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/OrthancMoveRequestHandler.h	Sat Jan 05 18:22:25 2019 +0100
@@ -33,10 +33,11 @@
 #pragma once
 
 #include "../Core/DicomNetworking/IMoveRequestHandler.h"
-#include "ServerContext.h"
 
 namespace Orthanc
 {
+  class ServerContext;
+  
   class OrthancMoveRequestHandler : public IMoveRequestHandler
   {
   private:
--- a/OrthancServer/OrthancRestApi/OrthancRestArchive.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/OrthancRestApi/OrthancRestArchive.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -35,9 +35,12 @@
 #include "OrthancRestApi.h"
 
 #include "../../Core/HttpServer/FilesystemHttpSender.h"
+#include "../../Core/OrthancException.h"
 #include "../../Core/SerializationToolbox.h"
+#include "../ServerContext.h"
 #include "../ServerJobs/ArchiveJob.h"
 
+
 namespace Orthanc
 {
   static const char* const KEY_RESOURCES = "Resources";
--- a/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/OrthancRestApi/OrthancRestModalities.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -34,9 +34,11 @@
 #include "../PrecompiledHeadersServer.h"
 #include "OrthancRestApi.h"
 
+#include "../../Core/Cache/SharedArchive.h"
 #include "../../Core/DicomParsing/FromDcmtkBridge.h"
 #include "../../Core/Logging.h"
 #include "../../Core/SerializationToolbox.h"
+
 #include "../OrthancConfiguration.h"
 #include "../QueryRetrieveHandler.h"
 #include "../ServerJobs/DicomModalityStoreJob.h"
--- a/OrthancServer/ServerContext.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerContext.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -34,12 +34,14 @@
 #include "PrecompiledHeadersServer.h"
 #include "ServerContext.h"
 
+#include "../Core/Cache/SharedArchive.h"
 #include "../Core/DicomParsing/FromDcmtkBridge.h"
 #include "../Core/FileStorage/StorageAccessor.h"
 #include "../Core/HttpServer/FilesystemHttpSender.h"
 #include "../Core/HttpServer/HttpStreamTranscoder.h"
 #include "../Core/Logging.h"
 #include "../Plugins/Engine/OrthancPlugins.h"
+
 #include "OrthancConfiguration.h"
 #include "OrthancRestApi/OrthancRestApi.h"
 #include "Search/DatabaseLookup.h"
--- a/OrthancServer/ServerContext.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerContext.h	Sat Jan 05 18:22:25 2019 +0100
@@ -40,8 +40,6 @@
 #include "ServerIndex.h"
 
 #include "../Core/Cache/MemoryCache.h"
-#include "../Core/Cache/SharedArchive.h"
-#include "../Core/DicomParsing/ParsedDicomFile.h"
 #include "../Core/FileStorage/IStorageArea.h"
 #include "../Core/JobsEngine/JobsEngine.h"
 #include "../Core/JobsEngine/SetOfInstancesJob.h"
@@ -55,6 +53,8 @@
 namespace Orthanc
 {
   class OrthancPlugins;
+  class ParsedDicomFile;
+  class SharedArchive;
   
   /**
    * This class is responsible for maintaining the storage area on the
--- a/OrthancServer/ServerIndex.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerIndex.h	Sat Jan 05 18:22:25 2019 +0100
@@ -35,10 +35,8 @@
 
 #include "../Core/Cache/LeastRecentlyUsedIndex.h"
 #include "../Core/DicomFormat/DicomMap.h"
-#include "../Core/SQLite/Connection.h"
 
 #include "Database/IDatabaseWrapper.h"
-#include "ServerEnumerations.h"
 
 #include <boost/thread.hpp>
 #include <boost/noncopyable.hpp>
--- a/OrthancServer/ServerJobs/ArchiveJob.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/ArchiveJob.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -34,10 +34,12 @@
 #include "../PrecompiledHeadersServer.h"
 #include "ArchiveJob.h"
 
+#include "../../Core/Cache/SharedArchive.h"
 #include "../../Core/Compression/HierarchicalZipWriter.h"
 #include "../../Core/DicomParsing/DicomDirWriter.h"
 #include "../../Core/Logging.h"
 #include "../../Core/OrthancException.h"
+#include "../ServerContext.h"
 
 #include <stdio.h>
 
--- a/OrthancServer/ServerJobs/ArchiveJob.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/ArchiveJob.h	Sat Jan 05 18:22:25 2019 +0100
@@ -35,10 +35,13 @@
 
 #include "../../Core/JobsEngine/IJob.h"
 #include "../../Core/TemporaryFile.h"
-#include "../ServerContext.h"
+
+#include <boost/shared_ptr.hpp>
 
 namespace Orthanc
 {
+  class ServerContext;
+  
   class ArchiveJob : public IJob
   {
   private:
--- a/OrthancServer/ServerJobs/DicomModalityStoreJob.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/DicomModalityStoreJob.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -36,6 +36,8 @@
 
 #include "../../Core/Logging.h"
 #include "../../Core/SerializationToolbox.h"
+#include "../ServerContext.h"
+
 
 namespace Orthanc
 {
--- a/OrthancServer/ServerJobs/DicomModalityStoreJob.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/DicomModalityStoreJob.h	Sat Jan 05 18:22:25 2019 +0100
@@ -36,10 +36,10 @@
 #include "../../Core/JobsEngine/SetOfInstancesJob.h"
 #include "../../Core/DicomNetworking/DicomUserConnection.h"
 
-#include "../ServerContext.h"
-
 namespace Orthanc
 {
+  class ServerContext;
+  
   class DicomModalityStoreJob : public SetOfInstancesJob
   {
   private:
--- a/OrthancServer/ServerJobs/DicomMoveScuJob.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/DicomMoveScuJob.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -34,6 +34,7 @@
 #include "DicomMoveScuJob.h"
 
 #include "../../Core/SerializationToolbox.h"
+#include "../ServerContext.h"
 
 namespace Orthanc
 {
--- a/OrthancServer/ServerJobs/DicomMoveScuJob.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/DicomMoveScuJob.h	Sat Jan 05 18:22:25 2019 +0100
@@ -37,10 +37,11 @@
 #include "../../Core/DicomNetworking/DicomUserConnection.h"
 
 #include "../QueryRetrieveHandler.h"
-#include "../ServerContext.h"
 
 namespace Orthanc
 {
+  class ServerContext;
+  
   class DicomMoveScuJob : public SetOfCommandsJob
   {
   private:
--- a/OrthancServer/ServerJobs/MergeStudyJob.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/MergeStudyJob.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -36,6 +36,7 @@
 #include "../../Core/DicomParsing/FromDcmtkBridge.h"
 #include "../../Core/Logging.h"
 #include "../../Core/SerializationToolbox.h"
+#include "../ServerContext.h"
 
 
 namespace Orthanc
--- a/OrthancServer/ServerJobs/MergeStudyJob.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/MergeStudyJob.h	Sat Jan 05 18:22:25 2019 +0100
@@ -33,12 +33,14 @@
 
 #pragma once
 
+#include "../../Core/DicomFormat/DicomMap.h"
 #include "../../Core/JobsEngine/SetOfInstancesJob.h"
-
-#include "../ServerContext.h"
+#include "../DicomInstanceOrigin.h"
 
 namespace Orthanc
 {
+  class ServerContext;
+  
   class MergeStudyJob : public SetOfInstancesJob
   {
   private:
--- a/OrthancServer/ServerJobs/Operations/DeleteResourceOperation.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/Operations/DeleteResourceOperation.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -35,6 +35,7 @@
 #include "DeleteResourceOperation.h"
 
 #include "DicomInstanceOperationValue.h"
+#include "../../ServerContext.h"
 
 #include "../../../Core/Logging.h"
 #include "../../../Core/OrthancException.h"
--- a/OrthancServer/ServerJobs/Operations/DeleteResourceOperation.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/Operations/DeleteResourceOperation.h	Sat Jan 05 18:22:25 2019 +0100
@@ -35,10 +35,10 @@
 
 #include "../../../Core/JobsEngine/Operations/IJobOperation.h"
 
-#include "../../ServerContext.h"
-
 namespace Orthanc
 {
+  class ServerContext;
+  
   class DeleteResourceOperation : public IJobOperation
   {
   private:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OrthancServer/ServerJobs/Operations/DicomInstanceOperationValue.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -0,0 +1,45 @@
+/**
+ * Orthanc - A Lightweight, RESTful DICOM Store
+ * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
+ * Department, University Hospital of Liege, Belgium
+ * Copyright (C) 2017-2019 Osimis S.A., Belgium
+ *
+ * This program is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * In addition, as a special exception, the copyright holders of this
+ * program give permission to link the code of its release with the
+ * OpenSSL project's "OpenSSL" library (or with modified versions of it
+ * that use the same license as the "OpenSSL" library), and distribute
+ * the linked executables. You must obey the GNU General Public License
+ * in all respects for all of the code used other than "OpenSSL". If you
+ * modify file(s) with this exception, you may extend this exception to
+ * your version of the file(s), but you are not obligated to do so. If
+ * you do not wish to do so, delete this exception statement from your
+ * version. If you delete this exception statement from all source files
+ * in the program, then also delete it here.
+ * 
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ **/
+
+
+#include "../../PrecompiledHeadersServer.h"
+#include "DicomInstanceOperationValue.h"
+
+#include "../../ServerContext.h"
+
+namespace Orthanc
+{
+  void DicomInstanceOperationValue::ReadDicom(std::string& dicom) const
+  {
+    context_.ReadDicom(dicom, id_);
+  }
+}
--- a/OrthancServer/ServerJobs/Operations/DicomInstanceOperationValue.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/Operations/DicomInstanceOperationValue.h	Sat Jan 05 18:22:25 2019 +0100
@@ -35,10 +35,10 @@
 
 #include "../../../Core/JobsEngine/Operations/JobOperationValue.h"
 
-#include "../../ServerContext.h"
-
 namespace Orthanc
 {
+  class ServerContext;
+  
   class DicomInstanceOperationValue : public JobOperationValue
   {
   private:
@@ -64,10 +64,7 @@
       return id_;
     }
 
-    void ReadDicom(std::string& dicom) const
-    {
-      context_.ReadDicom(dicom, id_);
-    }
+    void ReadDicom(std::string& dicom) const;
 
     virtual JobOperationValue* Clone() const
     {
--- a/OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -35,6 +35,7 @@
 #include "ModifyInstanceOperation.h"
 
 #include "DicomInstanceOperationValue.h"
+#include "../../ServerContext.h"
 
 #include "../../../Core/Logging.h"
 #include "../../../Core/SerializationToolbox.h"
--- a/OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/Operations/ModifyInstanceOperation.h	Sat Jan 05 18:22:25 2019 +0100
@@ -36,10 +36,10 @@
 #include "../../../Core/JobsEngine/Operations/IJobOperation.h"
 #include "../../../Core/DicomParsing/DicomModification.h"
 
-#include "../../ServerContext.h"
-
 namespace Orthanc
 {
+  class ServerContext;
+  
   class ModifyInstanceOperation : public IJobOperation
   {
   private:
--- a/OrthancServer/ServerJobs/Operations/SystemCallOperation.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/Operations/SystemCallOperation.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -42,6 +42,7 @@
 #include "../../../Core/SerializationToolbox.h"
 #include "../../../Core/TemporaryFile.h"
 #include "../../../Core/Toolbox.h"
+#include "../../../Core/SystemToolbox.h"
 
 namespace Orthanc
 {
--- a/OrthancServer/ServerJobs/OrthancJobUnserializer.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/OrthancJobUnserializer.h	Sat Jan 05 18:22:25 2019 +0100
@@ -33,11 +33,12 @@
 
 #pragma once
 
-#include "../ServerContext.h"
 #include "../../Core/JobsEngine/GenericJobUnserializer.h"
 
 namespace Orthanc
 {
+  class ServerContext;
+  
   class OrthancJobUnserializer : public GenericJobUnserializer
   {
   private:
--- a/OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/OrthancPeerStoreJob.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -35,6 +35,7 @@
 #include "OrthancPeerStoreJob.h"
 
 #include "../../Core/Logging.h"
+#include "../ServerContext.h"
 
 
 namespace Orthanc
--- a/OrthancServer/ServerJobs/OrthancPeerStoreJob.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/OrthancPeerStoreJob.h	Sat Jan 05 18:22:25 2019 +0100
@@ -36,11 +36,11 @@
 #include "../../Core/JobsEngine/SetOfInstancesJob.h"
 #include "../../Core/HttpClient.h"
 
-#include "../ServerContext.h"
-
 
 namespace Orthanc
 {
+  class ServerContext;
+  
   class OrthancPeerStoreJob : public SetOfInstancesJob
   {
   private:
--- a/OrthancServer/ServerJobs/ResourceModificationJob.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/ResourceModificationJob.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -36,6 +36,7 @@
 
 #include "../../Core/Logging.h"
 #include "../../Core/SerializationToolbox.h"
+#include "../ServerContext.h"
 
 namespace Orthanc
 {
--- a/OrthancServer/ServerJobs/ResourceModificationJob.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/ResourceModificationJob.h	Sat Jan 05 18:22:25 2019 +0100
@@ -34,10 +34,13 @@
 #pragma once
 
 #include "../../Core/JobsEngine/SetOfInstancesJob.h"
-#include "../ServerContext.h"
+#include "../../Core/DicomParsing/DicomModification.h"
+#include "../DicomInstanceOrigin.h"
 
 namespace Orthanc
 {
+  class ServerContext;
+  
   class ResourceModificationJob : public SetOfInstancesJob
   {
   private:
--- a/OrthancServer/ServerJobs/SplitStudyJob.cpp	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/SplitStudyJob.cpp	Sat Jan 05 18:22:25 2019 +0100
@@ -36,6 +36,8 @@
 #include "../../Core/DicomParsing/FromDcmtkBridge.h"
 #include "../../Core/Logging.h"
 #include "../../Core/SerializationToolbox.h"
+#include "../ServerContext.h"
+
 
 namespace Orthanc
 {
--- a/OrthancServer/ServerJobs/SplitStudyJob.h	Sat Jan 05 17:52:24 2019 +0100
+++ b/OrthancServer/ServerJobs/SplitStudyJob.h	Sat Jan 05 18:22:25 2019 +0100
@@ -34,11 +34,13 @@
 #pragma once
 
 #include "../../Core/JobsEngine/SetOfInstancesJob.h"
-
-#include "../ServerContext.h"
+#include "../../Core/DicomFormat/DicomTag.h"
+#include "../DicomInstanceOrigin.h"
 
 namespace Orthanc
 {
+  class ServerContext;
+  
   class SplitStudyJob : public SetOfInstancesJob
   {
   private: