comparison Framework/Loaders/DicomSource.cpp @ 1299:c38c89684d83 broker

replacing std::auto_ptr by std::unique_ptr
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 02 Mar 2020 17:21:24 +0100
parents 0ca50d275b9a
children 30deba7bc8e2
comparison
equal deleted inserted replaced
1297:6ab03e429f06 1299:c38c89684d83
142 IOracleCommand* DicomSource::CreateDicomWebCommand(const std::string& uri, 142 IOracleCommand* DicomSource::CreateDicomWebCommand(const std::string& uri,
143 const std::map<std::string, std::string>& arguments, 143 const std::map<std::string, std::string>& arguments,
144 const std::map<std::string, std::string>& headers, 144 const std::map<std::string, std::string>& headers,
145 Orthanc::IDynamicObject* payload) const 145 Orthanc::IDynamicObject* payload) const
146 { 146 {
147 std::auto_ptr<Orthanc::IDynamicObject> protection(payload); 147 std::unique_ptr<Orthanc::IDynamicObject> protection(payload);
148 148
149 switch (type_) 149 switch (type_)
150 { 150 {
151 case DicomSourceType_DicomWeb: 151 case DicomSourceType_DicomWeb:
152 { 152 {
153 std::auto_ptr<HttpCommand> command(new HttpCommand); 153 std::unique_ptr<HttpCommand> command(new HttpCommand);
154 154
155 command->SetMethod(Orthanc::HttpMethod_Get); 155 command->SetMethod(Orthanc::HttpMethod_Get);
156 command->SetUrl(webService_.GetUrl() + "/" + EncodeGetArguments(uri, arguments)); 156 command->SetUrl(webService_.GetUrl() + "/" + EncodeGetArguments(uri, arguments));
157 command->SetHttpHeaders(webService_.GetHttpHeaders()); 157 command->SetHttpHeaders(webService_.GetHttpHeaders());
158 158
194 Json::Value body = Json::objectValue; 194 Json::Value body = Json::objectValue;
195 body["Uri"] = uri; 195 body["Uri"] = uri;
196 body["Arguments"] = args; 196 body["Arguments"] = args;
197 body["Headers"] = h; 197 body["Headers"] = h;
198 198
199 std::auto_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand); 199 std::unique_ptr<OrthancRestApiCommand> command(new OrthancRestApiCommand);
200 command->SetMethod(Orthanc::HttpMethod_Post); 200 command->SetMethod(Orthanc::HttpMethod_Post);
201 command->SetUri(orthancDicomWebRoot_ + "/servers/" + serverName_ + "/get"); 201 command->SetUri(orthancDicomWebRoot_ + "/servers/" + serverName_ + "/get");
202 command->SetBody(body); 202 command->SetBody(body);
203 203
204 if (protection.get()) 204 if (protection.get())