Arkanjo
0.2
A tool for find code duplicated functions in codebases
Loading...
Searching...
No Matches
orchestrator.hpp
Go to the documentation of this file.
1
13
#pragma once
14
15
#include <
arkanjo/base/function.hpp
>
16
#include <
arkanjo/base/path.hpp
>
17
18
#include <
arkanjo/base/similarity_table.hpp
>
19
#include <
arkanjo/utils/utils.hpp
>
20
21
#include <
arkanjo/cli/parser_options.hpp
>
22
23
struct
Context
{
24
std::string
command_name
;
25
ParsedOptions
options
;
26
std::vector<std::string>
extra_args
;
27
28
int
argc
;
29
char
**
argv
;
30
};
31
32
using
Step
= std::function<bool(
Context
&)>;
38
class
Orchestrator
{
39
private
:
40
std::vector<Step> steps;
41
size_t
current_step = 0;
42
43
public
:
44
void
add_step
(
Step
step) { steps.push_back(step); }
45
46
void
skip
() {
47
current_step = steps.size();
48
}
49
50
void
run_pipeline
(
Context
& ctx) {
51
for
(current_step = 0; current_step < steps.size(); ++current_step) {
52
if
(!steps[current_step] || !steps[current_step](ctx)) {
53
std::cerr <<
"Pipeline aborted ("
<< current_step <<
")\n"
;
54
break
;
55
}
56
}
57
}
58
};
Orchestrator
Main command orchestrator.
Definition
orchestrator.hpp:38
Orchestrator::run_pipeline
void run_pipeline(Context &ctx)
Definition
orchestrator.hpp:50
Orchestrator::skip
void skip()
Definition
orchestrator.hpp:46
Orchestrator::add_step
void add_step(Step step)
Definition
orchestrator.hpp:44
function.hpp
Function abstraction for temporary codebase.
Step
std::function< bool(Context &)> Step
Definition
orchestrator.hpp:32
parser_options.hpp
path.hpp
Path abstraction for temporary codebase.
similarity_table.hpp
Similarity relationships storage and analysis.
Context
Definition
orchestrator.hpp:23
Context::argv
char ** argv
Definition
orchestrator.hpp:29
Context::argc
int argc
Definition
orchestrator.hpp:28
Context::options
ParsedOptions options
Definition
orchestrator.hpp:25
Context::command_name
std::string command_name
Definition
orchestrator.hpp:24
Context::extra_args
std::vector< std::string > extra_args
Definition
orchestrator.hpp:26
ParsedOptions
Definition
parser_options.hpp:28
utils.hpp
Defines utility functions used across all files.
include
arkanjo
orchestrator.hpp
Generated by
1.12.0