Mercurial > hg > orthanc-databases
comparison MySQL/Plugins/MySQLIndex.cpp @ 201:42990b2dd51b
create IDatabaseBackendOutput only if needed
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 18 Mar 2021 16:51:51 +0100 |
parents | 8cae98f73d53 |
children | 2089d4071408 |
comparison
equal
deleted
inserted
replaced
200:30b210616f4f | 201:42990b2dd51b |
---|---|
265 | 265 |
266 return db.release(); | 266 return db.release(); |
267 } | 267 } |
268 | 268 |
269 | 269 |
270 MySQLIndex::MySQLIndex(const MySQLParameters& parameters) : | 270 MySQLIndex::MySQLIndex(OrthancPluginContext* context, |
271 IndexBackend(new Factory(*this)), | 271 const MySQLParameters& parameters) : |
272 IndexBackend(context, new Factory(*this)), | |
272 parameters_(parameters), | 273 parameters_(parameters), |
273 clearAll_(false) | 274 clearAll_(false) |
274 { | 275 { |
275 } | 276 } |
276 | 277 |
303 return ReadInteger64(statement, 0); | 304 return ReadInteger64(statement, 0); |
304 } | 305 } |
305 } | 306 } |
306 | 307 |
307 | 308 |
308 void MySQLIndex::DeleteResource(int64_t id) | 309 void MySQLIndex::DeleteResource(OrthancPlugins::IDatabaseBackendOutput& output, |
310 int64_t id) | |
309 { | 311 { |
310 ClearDeletedFiles(); | 312 ClearDeletedFiles(); |
311 | 313 |
312 // Recursive exploration of resources to be deleted, from the "id" | 314 // Recursive exploration of resources to be deleted, from the "id" |
313 // resource to the top of the tree of resources | 315 // resource to the top of the tree of resources |
361 Dictionary args; | 363 Dictionary args; |
362 args.SetIntegerValue("id", parentId); | 364 args.SetIntegerValue("id", parentId); |
363 | 365 |
364 parent.Execute(args); | 366 parent.Execute(args); |
365 | 367 |
366 GetOutput().SignalRemainingAncestor( | 368 output.SignalRemainingAncestor( |
367 ReadString(parent, 0), | 369 ReadString(parent, 0), |
368 static_cast<OrthancPluginResourceType>(ReadInteger32(parent, 1))); | 370 static_cast<OrthancPluginResourceType>(ReadInteger32(parent, 1))); |
369 } | 371 } |
370 } | 372 } |
371 } | 373 } |
382 args.SetIntegerValue("id", id); | 384 args.SetIntegerValue("id", id); |
383 | 385 |
384 deleteHierarchy.Execute(args); | 386 deleteHierarchy.Execute(args); |
385 } | 387 } |
386 | 388 |
387 SignalDeletedFiles(); | 389 SignalDeletedFiles(output); |
388 } | 390 } |
389 | 391 |
390 | 392 |
391 int64_t MySQLIndex::GetLastChangeIndex() | 393 int64_t MySQLIndex::GetLastChangeIndex() |
392 { | 394 { |