Initial commit

This commit is contained in:
Matthias
2017-04-11 15:49:21 +02:00
commit ec80b339e2
2081 changed files with 968992 additions and 0 deletions
+49
View File
@@ -0,0 +1,49 @@
#pragma once
#include <exception>
#include <memory>
namespace wfr {
// Forward declarations
namespace scheduling {
class SchedulingDecision;
}
namespace execution {
enum class ExecutionHandleState
: int { Unknown,
Pending,
Running,
Finished,
Error };
class ExecutionHandle {
// Invariant properties that can be accessed directly.
public:
std::shared_ptr<wfr::scheduling::SchedulingDecision> schedulingDecision = nullptr;
// Mutable properties that need to be accessed via getter-/setter-functions.
private:
ExecutionHandleState state = ExecutionHandleState::Unknown;
std::exception_ptr errorCause = nullptr;
public:
ExecutionHandle(std::shared_ptr<wfr::scheduling::SchedulingDecision> schedulingDecision) noexcept :
schedulingDecision(schedulingDecision), state(ExecutionHandleState::Pending) {}
std::exception_ptr getErrorCause() const noexcept { return errorCause; }
void setErrorCause(std::exception_ptr errorCause) noexcept { this->errorCause = errorCause; }
ExecutionHandleState getState() const noexcept { return state; }
void setState(ExecutionHandleState state) noexcept { this->state = state; }
};
} /* namespace execution */
} /* namespace wfr */