changeset 4583:42a846166fa3 db-changes

removing link to ServerIndex in ReadWriteTransaction
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 09 Mar 2021 15:37:47 +0100
parents fb0379abb4a7
children b25941dcdbbe
files OrthancServer/Sources/ServerIndex.cpp OrthancServer/Sources/ServerIndex.h
diffstat 2 files changed, 15 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/OrthancServer/Sources/ServerIndex.cpp	Tue Mar 09 15:25:17 2021 +0100
+++ b/OrthancServer/Sources/ServerIndex.cpp	Tue Mar 09 15:37:47 2021 +0100
@@ -1091,7 +1091,7 @@
           Transaction transaction(*this, TransactionType_ReadWrite);
           {
             assert(listener_.get() != NULL);
-            ReadWriteTransaction t(db_, *listener_, *this);
+            ReadWriteTransaction t(db_, *listener_);
             writeOperations->Apply(t);
           }
           transaction.Commit();
@@ -3081,17 +3081,6 @@
   }
 
 
-  static void SetInstanceMetadata(ResourcesContent& content,
-                                  std::map<MetadataType, std::string>& instanceMetadata,
-                                  int64_t instance,
-                                  MetadataType metadata,
-                                  const std::string& value)
-  {
-    content.AddMetadata(instance, metadata, value);
-    instanceMetadata[metadata] = value;
-  }
-
-
   StoreStatus ServerIndex::Store(std::map<MetadataType, std::string>& instanceMetadata,
                                  const DicomMap& dicomSummary,
                                  const Attachments& attachments,
@@ -3128,6 +3117,18 @@
       std::string   hashStudy_;
       std::string   hashSeries_;
       std::string   hashInstance_;
+
+      
+      static void SetInstanceMetadata(ResourcesContent& content,
+                                      std::map<MetadataType, std::string>& instanceMetadata,
+                                      int64_t instance,
+                                      MetadataType metadata,
+                                      const std::string& value)
+      {
+        content.AddMetadata(instance, metadata, value);
+        instanceMetadata[metadata] = value;
+      }
+
       
       static bool ComputeExpectedNumberOfInstances(int64_t& target,
                                                    const DicomMap& dicomSummary)
--- a/OrthancServer/Sources/ServerIndex.h	Tue Mar 09 15:25:17 2021 +0100
+++ b/OrthancServer/Sources/ServerIndex.h	Tue Mar 09 15:37:47 2021 +0100
@@ -309,15 +309,12 @@
     {
     private:
       Listener&  listener_;
-      ServerIndex&  index_;   // TODO - REMOVE
       
     public:
       ReadWriteTransaction(IDatabaseWrapper& db,
-                           Listener& listener,
-                           ServerIndex& index) :
+                           Listener& listener) :
         ReadOnlyTransaction(db),
-        listener_(listener),
-        index_(index)
+        listener_(listener)
       {
       }