-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathworkflow.h
44 lines (37 loc) · 1.09 KB
/
workflow.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#pragma once
#include <fstream>
#include <iostream>
#include <list>
#include <string>
#include <vector>
#include <map>
#include "workflow_parser.h"
#include "worker.h"
#include "workers.h"
namespace wkfw{
class Workflow{
public:
Workflow(const std::string& ifname, std::string ofname);
Workflow(const Workflow& other);
~Workflow(){}
operator bool() const{
return !isEmpty;
}
const Worker* nextInstruction(void);
void run(void);
std::string ifname;
std::string ofname;
private:
std::map<uint32_t, const Worker*> description;
WorkflowParser parser;
bool isEmpty = false;
const Worker* getWorkerById(uint32_t id);
const std::string extractCmd(std::string cmd_line);
const std::vector<std::string> extractArgs(std::string cmd_line);
void reciveCmd(uint32_t id, std::string cmd);
void buildDescription();
void WorkflowException(std::string msg) {
std::cout << "Workflow exception: " << msg << std::endl;
}
};
}