diff 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
line wrap: on
line diff
--- a/Core/JobsEngine/JobStepResult.h	Wed May 16 14:40:05 2018 +0200
+++ b/Core/JobsEngine/JobStepResult.h	Wed May 16 16:23:20 2018 +0200
@@ -40,21 +40,46 @@
   class JobStepResult
   {
   private:
-    JobStepCode code_;
+    JobStepCode   code_;
+    unsigned int  timeout_;
+    ErrorCode     error_;
     
-  public:
     explicit JobStepResult(JobStepCode code) :
-      code_(code)
+      code_(code),
+      timeout_(0),
+      error_(ErrorCode_Success)
     {
     }
 
-    virtual ~JobStepResult()
+  public:
+    explicit JobStepResult() :
+      code_(JobStepCode_Failure),
+      timeout_(0),
+      error_(ErrorCode_InternalError)
     {
     }
 
+    static JobStepResult Success()
+    {
+      return JobStepResult(JobStepCode_Success);
+    }
+
+    static JobStepResult Continue()
+    {
+      return JobStepResult(JobStepCode_Continue);
+    }
+
+    static JobStepResult Retry(unsigned int timeout);
+
+    static JobStepResult Failure(const ErrorCode& error);
+
     JobStepCode GetCode() const
     {
       return code_;
     }
+
+    unsigned int GetRetryTimeout() const;
+
+    ErrorCode GetFailureCode() const;
   };
 }