# HG changeset patch # User Sebastien Jodogne # Date 1583845154 -3600 # Node ID 77183afbf55e79d123a29268572f87f6074eb016 # Parent 4fc24b69446ae858097039dcd1fc178444c291b7 simplification diff -r 4fc24b69446a -r 77183afbf55e OrthancServer/ServerJobs/DicomModalityStoreJob.cpp --- a/OrthancServer/ServerJobs/DicomModalityStoreJob.cpp Tue Mar 10 13:22:02 2020 +0100 +++ b/OrthancServer/ServerJobs/DicomModalityStoreJob.cpp Tue Mar 10 13:59:14 2020 +0100 @@ -102,8 +102,10 @@ assert(IsStarted()); OpenConnection(); - - connection_->RequestStorageCommitment(transactionUid_, sopClassUids_, sopInstanceUids_); + + std::vector a(sopClassUids_.begin(), sopClassUids_.end()); + std::vector b(sopInstanceUids_.begin(), sopInstanceUids_.end()); + connection_->RequestStorageCommitment(transactionUid_, a, b); } } @@ -125,6 +127,7 @@ moveOriginatorId_(0), // By default, not a C-MOVE storageCommitment_(false) // By default, no storage commitment { + ResetStorageCommitment(); } @@ -210,19 +213,12 @@ if (storageCommitment_) { transactionUid_ = Toolbox::GenerateDicomPrivateUniqueIdentifier(); - sopClassUids_.reserve(GetInstancesCount()); - sopInstanceUids_.reserve(GetInstancesCount()); + sopClassUids_.clear(); + sopInstanceUids_.clear(); } } - void DicomModalityStoreJob::Start() - { - SetOfInstancesJob::Start(); - ResetStorageCommitment(); - } - - void DicomModalityStoreJob::Reset() { SetOfInstancesJob::Reset(); @@ -240,6 +236,7 @@ void DicomModalityStoreJob::EnableStorageCommitment(bool enabled) { storageCommitment_ = enabled; + ResetStorageCommitment(); } diff -r 4fc24b69446a -r 77183afbf55e OrthancServer/ServerJobs/DicomModalityStoreJob.h --- a/OrthancServer/ServerJobs/DicomModalityStoreJob.h Tue Mar 10 13:22:02 2020 +0100 +++ b/OrthancServer/ServerJobs/DicomModalityStoreJob.h Tue Mar 10 13:59:14 2020 +0100 @@ -53,9 +53,9 @@ bool storageCommitment_; // For storage commitment - std::string transactionUid_; - std::vector sopInstanceUids_; - std::vector sopClassUids_; + std::string transactionUid_; + std::list sopInstanceUids_; + std::list sopClassUids_; void OpenConnection(); @@ -109,8 +109,6 @@ virtual bool Serialize(Json::Value& target); - virtual void Start() ORTHANC_OVERRIDE; - virtual void Reset() ORTHANC_OVERRIDE; void EnableStorageCommitment(bool enabled);