comparison Core/JobsEngine/JobStepResult.h @ 2598:34dc57f4a7d2 jobs

simplification of JobStepResult
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 16 May 2018 16:23:20 +0200
parents 2af17cd5eb1f
children 4e43e67f8ecf
comparison
equal deleted inserted replaced
2597:ef7ba1b21d58 2598:34dc57f4a7d2
38 namespace Orthanc 38 namespace Orthanc
39 { 39 {
40 class JobStepResult 40 class JobStepResult
41 { 41 {
42 private: 42 private:
43 JobStepCode code_; 43 JobStepCode code_;
44 unsigned int timeout_;
45 ErrorCode error_;
44 46
45 public:
46 explicit JobStepResult(JobStepCode code) : 47 explicit JobStepResult(JobStepCode code) :
47 code_(code) 48 code_(code),
49 timeout_(0),
50 error_(ErrorCode_Success)
48 { 51 {
49 } 52 }
50 53
51 virtual ~JobStepResult() 54 public:
55 explicit JobStepResult() :
56 code_(JobStepCode_Failure),
57 timeout_(0),
58 error_(ErrorCode_InternalError)
52 { 59 {
53 } 60 }
61
62 static JobStepResult Success()
63 {
64 return JobStepResult(JobStepCode_Success);
65 }
66
67 static JobStepResult Continue()
68 {
69 return JobStepResult(JobStepCode_Continue);
70 }
71
72 static JobStepResult Retry(unsigned int timeout);
73
74 static JobStepResult Failure(const ErrorCode& error);
54 75
55 JobStepCode GetCode() const 76 JobStepCode GetCode() const
56 { 77 {
57 return code_; 78 return code_;
58 } 79 }
80
81 unsigned int GetRetryTimeout() const;
82
83 ErrorCode GetFailureCode() const;
59 }; 84 };
60 } 85 }