-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.h
51 lines (41 loc) · 1.19 KB
/
run.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
45
46
47
48
49
50
51
#ifndef RUN_H
#define RUN_H
#include <mutex>
#include <ostream>
#include <unordered_map>
#include <unordered_set>
#include "run_node.h"
class Run final
{
public:
const state_t states;
const state_t start;
private:
const Run_node **grafts;
const Run_node **dependencies;
std::unordered_set<const Run_node *> roots;
std::mutex *lock;
public:
Run(const state_t, const state_t);
Run(const Run &) = delete;
Run(Run &&) = delete;
~Run();
Run &operator=(const Run &) = delete;
Run &operator=(Run &&) = delete;
bool nonempty(const state_t q) const { return nullptr != grafts[q]; };
void save_subruns(const Run_node *const);
std::ostream &print_logic_prog_rep(std::ostream &) const;
private:
void save_subruns_aux(const Run_node *const, const Run_node *const);
std::ostream &print_logic_prog_rep_aux(
std::ostream &, const Run_node *const, runid_t &, std::unordered_map<const Run_node *, runid_t> &) const;
std::ostream &out_aux(
std::ostream &,
const Run_node *const,
const runid_t,
runid_t &,
std::unordered_map<const Run_node *, runid_t> &) const;
friend std::ostream &operator<<(std::ostream &, const Run &);
};
std::ostream &operator<<(std::ostream &, const Run_node &);
#endif