comparison OrthancFramework/Sources/JobsEngine/JobInfo.cpp @ 4300:b30a8de92ad9

abi continued
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 05 Nov 2020 19:33:18 +0100
parents bf7b9edf6b81
children d9473bd5ed43
comparison
equal deleted inserted replaced
4299:3f85db78c441 4300:b30a8de92ad9
88 runtime_(boost::posix_time::milliseconds(0)), 88 runtime_(boost::posix_time::milliseconds(0)),
89 hasEta_(false) 89 hasEta_(false)
90 { 90 {
91 } 91 }
92 92
93 const std::string &JobInfo::GetIdentifier() const
94 {
95 return id_;
96 }
97
98 int JobInfo::GetPriority() const
99 {
100 return priority_;
101 }
102
103 JobState JobInfo::GetState() const
104 {
105 return state_;
106 }
107
108 const boost::posix_time::ptime &JobInfo::GetInfoTime() const
109 {
110 return timestamp_;
111 }
112
113 const boost::posix_time::ptime &JobInfo::GetCreationTime() const
114 {
115 return creationTime_;
116 }
117
118 const boost::posix_time::time_duration &JobInfo::GetRuntime() const
119 {
120 return runtime_;
121 }
122
123 bool JobInfo::HasEstimatedTimeOfArrival() const
124 {
125 return hasEta_;
126 }
127
93 128
94 bool JobInfo::HasCompletionTime() const 129 bool JobInfo::HasCompletionTime() const
95 { 130 {
96 return (state_ == JobState_Success || 131 return (state_ == JobState_Success ||
97 state_ == JobState_Failure); 132 state_ == JobState_Failure);
121 { 156 {
122 throw OrthancException(ErrorCode_BadSequenceOfCalls); 157 throw OrthancException(ErrorCode_BadSequenceOfCalls);
123 } 158 }
124 } 159 }
125 160
161 const JobStatus &JobInfo::GetStatus() const
162 {
163 return status_;
164 }
165
166 JobStatus &JobInfo::GetStatus()
167 {
168 return status_;
169 }
170
126 171
127 void JobInfo::Format(Json::Value& target) const 172 void JobInfo::Format(Json::Value& target) const
128 { 173 {
129 target = Json::objectValue; 174 target = Json::objectValue;
130 target["ID"] = id_; 175 target["ID"] = id_;