comparison Framework/Oracle/GetOrthancImageCommand.cpp @ 1098:17660df24c36 broker

simplification of IOracleRunner
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 25 Oct 2019 13:01:24 +0200
parents 81b29bc7c3d4
children 87fbeb823375
comparison
equal deleted inserted replaced
1097:4383382db01d 1098:17660df24c36
80 default: 80 default:
81 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); 81 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange);
82 } 82 }
83 } 83 }
84 84
85 void GetOrthancImageCommand::ProcessHttpAnswer(IMessageEmitter& emitter, 85 IMessage* GetOrthancImageCommand::ProcessHttpAnswer(const std::string& answer,
86 boost::weak_ptr<IObserver>& receiver, 86 const HttpHeaders& answerHeaders) const
87 const std::string& answer,
88 const HttpHeaders& answerHeaders) const
89 { 87 {
90 Orthanc::MimeType contentType = Orthanc::MimeType_Binary; 88 Orthanc::MimeType contentType = Orthanc::MimeType_Binary;
91 89
92 for (HttpHeaders::const_iterator it = answerHeaders.begin(); 90 for (HttpHeaders::const_iterator it = answerHeaders.begin();
93 it != answerHeaders.end(); ++it) 91 it != answerHeaders.end(); ++it)
145 { 143 {
146 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat); 144 throw Orthanc::OrthancException(Orthanc::ErrorCode_IncompatibleImageFormat);
147 } 145 }
148 } 146 }
149 147
150 SuccessMessage message(*this, image.release(), contentType); 148 return new SuccessMessage(*this, image.release(), contentType);
151 emitter.EmitMessage(receiver, message);
152 } 149 }
153 } 150 }