tekka
program.hpp
Go to the documentation of this file.
1
4#pragma once
5#ifndef PBT_PROGRAM_HPP_
6#define PBT_PROGRAM_HPP_
7
8#include <vector>
9#include <string>
10#include <memory>
11#include <stdexcept>
12
13namespace pbf {
14
15class Population;
16
18class exit_success: public std::logic_error {
19 public:
20 exit_success() noexcept: std::logic_error("") {}
21};
23
26class Program {
27 public:
29 Program(const std::vector<std::string>& args);
30 ~Program() = default;
32 void run();
34 void write() const;
35
36 private:
38 std::vector<std::string> command_args_ = {};
40 std::string config_ = "";
42 std::unique_ptr<Population> population_ = nullptr;
43};
44
45} // namespace pbf
46
47#endif /* PBT_PROGRAM_HPP_ */
Program class.
Definition program.hpp:26
Program(const std::vector< std::string > &args)
Initialize with command-line arguments.
Definition program.cpp:83
std::vector< std::string > command_args_
Command-line arguments.
Definition program.hpp:38
void run()
Top level function that should be called once from global main.
Definition program.cpp:125
std::string config_
Written to "config.json".
Definition program.hpp:40
std::unique_ptr< Population > population_
Population instance.
Definition program.hpp:42
void write() const
Output results to files.
Definition program.cpp:143