Mercurial > hg > orthanc
comparison Core/JobsEngine/JobsRegistry.cpp @ 3712:2a170a8f1faf
replacing std::auto_ptr by std::unique_ptr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 02 Mar 2020 15:32:45 +0100 |
parents | 94f4a18a79cc |
children | a2e4edc7b9aa |
comparison
equal
deleted
inserted
replaced
3709:1f4910999fe7 | 3712:2a170a8f1faf |
---|---|
56 { | 56 { |
57 private: | 57 private: |
58 std::string id_; | 58 std::string id_; |
59 JobState state_; | 59 JobState state_; |
60 std::string jobType_; | 60 std::string jobType_; |
61 std::auto_ptr<IJob> job_; | 61 std::unique_ptr<IJob> job_; |
62 int priority_; // "+inf()" means highest priority | 62 int priority_; // "+inf()" means highest priority |
63 boost::posix_time::ptime creationTime_; | 63 boost::posix_time::ptime creationTime_; |
64 boost::posix_time::ptime lastStateChangeTime_; | 64 boost::posix_time::ptime lastStateChangeTime_; |
65 boost::posix_time::time_duration runtime_; | 65 boost::posix_time::time_duration runtime_; |
66 boost::posix_time::ptime retryTime_; | 66 boost::posix_time::ptime retryTime_; |
667 if (handler == NULL) | 667 if (handler == NULL) |
668 { | 668 { |
669 throw OrthancException(ErrorCode_NullPointer); | 669 throw OrthancException(ErrorCode_NullPointer); |
670 } | 670 } |
671 | 671 |
672 std::auto_ptr<JobHandler> protection(handler); | 672 std::unique_ptr<JobHandler> protection(handler); |
673 | 673 |
674 { | 674 { |
675 boost::mutex::scoped_lock lock(mutex_); | 675 boost::mutex::scoped_lock lock(mutex_); |
676 CheckInvariants(); | 676 CheckInvariants(); |
677 | 677 |
1394 Json::Value::Members members = s[JOBS].getMemberNames(); | 1394 Json::Value::Members members = s[JOBS].getMemberNames(); |
1395 | 1395 |
1396 for (Json::Value::Members::const_iterator it = members.begin(); | 1396 for (Json::Value::Members::const_iterator it = members.begin(); |
1397 it != members.end(); ++it) | 1397 it != members.end(); ++it) |
1398 { | 1398 { |
1399 std::auto_ptr<JobHandler> job; | 1399 std::unique_ptr<JobHandler> job; |
1400 | 1400 |
1401 try | 1401 try |
1402 { | 1402 { |
1403 job.reset(new JobHandler(unserializer, s[JOBS][*it], *it)); | 1403 job.reset(new JobHandler(unserializer, s[JOBS][*it], *it)); |
1404 } | 1404 } |