Initial commit
This commit is contained in:
Executable
+66
@@ -0,0 +1,66 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wfr/common/types/LwdTypes.h>
|
||||
#include <mutex>
|
||||
#include <queue>
|
||||
#include <memory>
|
||||
#include <condition_variable>
|
||||
|
||||
|
||||
namespace wfr {
|
||||
|
||||
//Forward declarations
|
||||
namespace wfs {
|
||||
class Workflow;
|
||||
class ActivityInstance;
|
||||
}
|
||||
namespace wep {
|
||||
class WorkflowExecutionPlan;
|
||||
}
|
||||
namespace scheduling {
|
||||
class AbstractScheduler;
|
||||
}
|
||||
|
||||
// Main namespace
|
||||
namespace enactment {
|
||||
|
||||
|
||||
class EnactmentEngine {
|
||||
|
||||
// Mutable properties that need to be accessed via getter-/setter-functions.
|
||||
private:
|
||||
std::shared_ptr<wep::WorkflowExecutionPlan> wep;
|
||||
|
||||
bool breakExecutionLoop = false;
|
||||
|
||||
std::queue<wfs::ActivityInstance*> updateQueue;
|
||||
std::mutex updateMutex;
|
||||
std::condition_variable updateCondition;
|
||||
|
||||
bool enableWepDotFileWriter;
|
||||
bool enableEarlyEvaluation;
|
||||
|
||||
// Invariant properties that can be accessed directly.
|
||||
public:
|
||||
wfs::Workflow& workflow;
|
||||
scheduling::AbstractScheduler& scheduler;
|
||||
|
||||
// Public static functions
|
||||
public:
|
||||
static void init(int argc, char** argv);
|
||||
static void finish();
|
||||
|
||||
// Public functions
|
||||
public:
|
||||
EnactmentEngine(wfs::Workflow& workflow, scheduling::AbstractScheduler& scheduler) noexcept;
|
||||
|
||||
void workflowExecutionLoop(lwd::_wfr_lwd* input, lwd::_wfr_lwd* output);
|
||||
|
||||
void notifyActivityInstanceStateUpdate(wfs::ActivityInstance& ai, scheduling::AbstractScheduler& scheduler);
|
||||
};
|
||||
|
||||
} /* namespace wep */
|
||||
} /* namespace wfr */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user