diff OrthancServer/DicomInstanceToStore.h @ 3841:be7df7fe3d80

avoid one memcpy of the DICOM buffer on "POST /instances"
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 16 Apr 2020 16:58:37 +0200
parents 0c16051dfd56
children 281045a1e6db
line wrap: on
line diff
--- a/OrthancServer/DicomInstanceToStore.h	Wed Apr 15 22:17:42 2020 +0200
+++ b/OrthancServer/DicomInstanceToStore.h	Thu Apr 16 16:58:37 2020 +0200
@@ -59,8 +59,11 @@
     void SetOrigin(const DicomInstanceOrigin& origin);
     
     const DicomInstanceOrigin& GetOrigin() const;
-    
-    void SetBuffer(const std::string& dicom);
+
+    // WARNING: The buffer is not copied, it must not be removed as
+    // long as the "DicomInstanceToStore" object is alive
+    void SetBuffer(const void* dicom,
+                   size_t size);
 
     void SetParsedDicomFile(ParsedDicomFile& parsed);
 
@@ -76,7 +79,7 @@
                      MetadataType metadata,
                      const std::string& value);
 
-    const char* GetBufferData();
+    const void* GetBufferData();
 
     size_t GetBufferSize();