diff Framework/Loaders/LoadedDicomResources.cpp @ 1250:a8248b08115c broker

LoadedDicomResources::MergeResource()
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jan 2020 20:22:02 +0100
parents c471a0aa137b
children 0ca50d275b9a
line wrap: on
line diff
--- a/Framework/Loaders/LoadedDicomResources.cpp	Tue Jan 07 14:23:24 2020 +0100
+++ b/Framework/Loaders/LoadedDicomResources.cpp	Tue Jan 07 20:22:02 2020 +0100
@@ -100,6 +100,23 @@
   }
 
 
+  void LoadedDicomResources::MergeResource(Orthanc::DicomMap& target,
+                                           const std::string& id) const
+  {
+    Resources::const_iterator it = resources_.find(id);
+    
+    if (it == resources_.end())
+    {
+      throw Orthanc::OrthancException(Orthanc::ErrorCode_InexistentItem);
+    }
+    else
+    {
+      assert(it->second != NULL);
+      target.Merge(*it->second);
+    }
+  }
+  
+
   bool LoadedDicomResources::LookupStringValue(std::string& target,
                                                const std::string& id,
                                                const Orthanc::DicomTag& tag) const