diff OrthancServer/Internals/FindScp.cpp @ 1788:6a2d507ef064 worklists

getting rid of opaque data structures
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Nov 2015 16:11:28 +0100
parents 1b1d5470233f
children bdcc1dba4a53
line wrap: on
line diff
--- a/OrthancServer/Internals/FindScp.cpp	Wed Nov 18 15:50:32 2015 +0100
+++ b/OrthancServer/Internals/FindScp.cpp	Wed Nov 18 16:11:28 2015 +0100
@@ -133,10 +133,9 @@
           {
             if (data.worklistHandler_ != NULL)
             {
-              // TODO
-              /*std::auto_ptr<ParsedDicomFile> query(ParsedDicomFile::CreateFromDcmtkDataset(requestIdentifiers));
-              DicomWorklistAnswers a;
-              data.worklistHandler_->Handle(a, *query, *data.remoteIp_, *data.remoteAet_);*/
+              ParsedDicomFile query(*requestIdentifiers);
+              data.noCroppingOfResults_ = data.worklistHandler_->Handle(data.answers_, query,
+                                                                        *data.remoteIp_, *data.remoteAet_);
               ok = true;
             }
             else
@@ -188,11 +187,10 @@
         // There are pending results that are still to be sent
         response->DimseStatus = STATUS_Pending;
 
-        void* obj = data.answers_.GetAnswer(responseCount - 1).GetDcmtkObject();
-        DcmFileFormat* fileFormat = static_cast<DcmFileFormat*>(obj);
-        assert(fileFormat != NULL);
+        DcmFileFormat& fileFormat = data.answers_.GetAnswer(responseCount - 1).GetDcmtkObject();
 
-        *responseIdentifiers = new DcmDataset(*fileFormat->getDataset());
+        // TODO Is there a way to avoid this copy?
+        *responseIdentifiers = new DcmDataset(*fileFormat.getDataset());
       }
       else if (data.noCroppingOfResults_)
       {