diff Framework/Oracle/ParseDicomFileCommand.cpp @ 1134:87fbeb823375 broker

allocating messages from oracle commands on the stack
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 06 Nov 2019 15:16:45 +0100
parents a8bf81756839
children a0a33e5ea5bb
line wrap: on
line diff
--- a/Framework/Oracle/ParseDicomFileCommand.cpp	Wed Nov 06 12:56:23 2019 +0100
+++ b/Framework/Oracle/ParseDicomFileCommand.cpp	Wed Nov 06 15:16:45 2019 +0100
@@ -27,9 +27,16 @@
 
 namespace OrthancStone
 {
-  void ParseDicomFileCommand::SuccessMessage::Setup()
+  ParseDicomFileCommand::SuccessMessage::SuccessMessage(ParseDicomFileCommand& command,
+                                                        Orthanc::ParsedDicomFile& dicom,
+                                                        size_t fileSize,
+                                                        bool hasPixelData) :
+    OracleMessageBase(command),
+    dicom_(dicom),
+    fileSize_(fileSize),
+    hasPixelData_(hasPixelData)
   {
-    if (!dicom_->GetTagValue(sopInstanceUid_, Orthanc::DICOM_TAG_SOP_INSTANCE_UID))
+    if (!dicom.GetTagValue(sopInstanceUid_, Orthanc::DICOM_TAG_SOP_INSTANCE_UID))
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_BadFileFormat,
                                       "DICOM instance missing tag SOPInstanceUID");
@@ -37,32 +44,6 @@
   }
 
 
-  ParseDicomFileCommand::SuccessMessage::SuccessMessage(const ParseDicomFileCommand& command,
-                                                        DcmFileFormat& dicom,
-                                                        size_t fileSize,
-                                                        bool hasPixelData) :
-    OriginMessage(command),
-    fileSize_(fileSize),
-    hasPixelData_(hasPixelData)
-  {
-    dicom_.reset(new Orthanc::ParsedDicomFile(dicom));
-    Setup();
-  }
-
-
-  ParseDicomFileCommand::SuccessMessage::SuccessMessage(const ParseDicomFileCommand& command,
-                                                        boost::shared_ptr<Orthanc::ParsedDicomFile> dicom,
-                                                        size_t fileSize,
-                                                        bool hasPixelData) :
-    OriginMessage(command),
-    dicom_(dicom),
-    fileSize_(fileSize),
-    hasPixelData_(hasPixelData)
-  {
-    Setup();
-  }
-
-
   std::string ParseDicomFileCommand::GetDicomDirPath(const std::string& dicomDirPath,
                                                      const std::string& file)
   {