Mercurial > hg > orthanc
comparison OrthancServer/Plugins/Engine/OrthancPluginDatabase.cpp @ 4204:318c16cfccab
cppcheck
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Thu, 17 Sep 2020 16:18:01 +0200 |
parents | 05b8fd21089c |
children | 1bd14c900699 |
comparison
equal
deleted
inserted
replaced
4203:4d42408da117 | 4204:318c16cfccab |
---|---|
60 throw OrthancException(static_cast<ErrorCode>(code)); | 60 throw OrthancException(static_cast<ErrorCode>(code)); |
61 } | 61 } |
62 } | 62 } |
63 | 63 |
64 public: | 64 public: |
65 Transaction(OrthancPluginDatabase& that) : | 65 explicit Transaction(OrthancPluginDatabase& that) : |
66 that_(that) | 66 that_(that) |
67 { | 67 { |
68 } | 68 } |
69 | 69 |
70 virtual void Begin() | 70 virtual void Begin() ORTHANC_OVERRIDE |
71 { | 71 { |
72 CheckSuccess(that_.backend_.startTransaction(that_.payload_)); | 72 CheckSuccess(that_.backend_.startTransaction(that_.payload_)); |
73 } | 73 } |
74 | 74 |
75 virtual void Rollback() | 75 virtual void Rollback() ORTHANC_OVERRIDE |
76 { | 76 { |
77 CheckSuccess(that_.backend_.rollbackTransaction(that_.payload_)); | 77 CheckSuccess(that_.backend_.rollbackTransaction(that_.payload_)); |
78 } | 78 } |
79 | 79 |
80 virtual void Commit(int64_t diskSizeDelta) | 80 virtual void Commit(int64_t diskSizeDelta) ORTHANC_OVERRIDE |
81 { | 81 { |
82 if (that_.fastGetTotalSize_) | 82 if (that_.fastGetTotalSize_) |
83 { | 83 { |
84 CheckSuccess(that_.backend_.commitTransaction(that_.payload_)); | 84 CheckSuccess(that_.backend_.commitTransaction(that_.payload_)); |
85 } | 85 } |
227 void *payload) : | 227 void *payload) : |
228 library_(library), | 228 library_(library), |
229 errorDictionary_(errorDictionary), | 229 errorDictionary_(errorDictionary), |
230 backend_(backend), | 230 backend_(backend), |
231 payload_(payload), | 231 payload_(payload), |
232 listener_(NULL) | 232 listener_(NULL), |
233 fastGetTotalSize_(false), | |
234 currentDiskSize_(0), | |
235 answerDoneIgnored_(false) | |
233 { | 236 { |
234 static const char* const MISSING = " Missing extension in database index plugin: "; | 237 static const char* const MISSING = " Missing extension in database index plugin: "; |
235 | 238 |
236 ResetAnswers(); | 239 ResetAnswers(); |
237 | 240 |
569 } | 572 } |
570 | 573 |
571 | 574 |
572 void OrthancPluginDatabase::GetLastChange(std::list<ServerIndexChange>& target /*out*/) | 575 void OrthancPluginDatabase::GetLastChange(std::list<ServerIndexChange>& target /*out*/) |
573 { | 576 { |
574 bool ignored = false; | 577 answerDoneIgnored_ = false; |
575 | 578 |
576 ResetAnswers(); | 579 ResetAnswers(); |
577 answerChanges_ = ⌖ | 580 answerChanges_ = ⌖ |
578 answerDone_ = &ignored; | 581 answerDone_ = &answerDoneIgnored_; |
579 | 582 |
580 CheckSuccess(backend_.getLastChange(GetContext(), payload_)); | 583 CheckSuccess(backend_.getLastChange(GetContext(), payload_)); |
581 } | 584 } |
582 | 585 |
583 | 586 |
584 void OrthancPluginDatabase::GetLastExportedResource(std::list<ExportedResource>& target /*out*/) | 587 void OrthancPluginDatabase::GetLastExportedResource(std::list<ExportedResource>& target /*out*/) |
585 { | 588 { |
586 bool ignored = false; | 589 answerDoneIgnored_ = false; |
587 | 590 |
588 ResetAnswers(); | 591 ResetAnswers(); |
589 answerExportedResources_ = ⌖ | 592 answerExportedResources_ = ⌖ |
590 answerDone_ = &ignored; | 593 answerDone_ = &answerDoneIgnored_; |
591 | 594 |
592 CheckSuccess(backend_.getLastExportedResource(GetContext(), payload_)); | 595 CheckSuccess(backend_.getLastExportedResource(GetContext(), payload_)); |
593 } | 596 } |
594 | 597 |
595 | 598 |