-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathImplementationBase.hpp
39 lines (32 loc) · 1.17 KB
/
ImplementationBase.hpp
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
#ifndef IMPLEMENTATIONBASE_HPP
#define IMPLEMENTATIONBASE_HPP
#include "options/Options.hpp"
struct ImplementationBase {
private:
bool validate_;
protected:
ImplementationBase() : validate_(false), run_count(1), validate(validate_)
{
options.add('n', "count", "NUM", run_count,
"Number of times to run algorithm.");
options.add("validate", validate_, true,
"Output validation results.");
}
ImplementationBase(const ImplementationBase&) = delete;
void operator=(const ImplementationBase&) = delete;
Options options;
size_t run_count;
virtual void loadGraph(const std::string) = 0;
virtual void prepareRun() {}
virtual void runImplementation(std::ofstream&) = 0;
virtual void cleanupRun() {}
virtual void freeGraph() = 0;
public:
const bool& validate;
void operator()(const std::string& graphFile, std::ofstream&& output);
void operator()(const std::string& graphFile, const std::string& output);
void help(std::ostream& out, std::string prefix);
std::vector<std::string> setup(std::vector<std::string> args);
virtual ~ImplementationBase();
};
#endif