Loading...
Searching...
No Matches
Job.h
Go to the documentation of this file.
1/*
2** This file is part of eOn.
3**
4** SPDX-License-Identifier: BSD-3-Clause
5**
6** Copyright (c) 2010--present, eOn Development Team
7** All rights reserved.
8**
9** Repo:
10** https://github.com/TheochemUI/eOn
11*/
12#pragma once
13#include "Parameters.h"
14#include "Potential.h"
15#include <string>
16#include <vector>
17
18namespace eonc {
19
29
44
48
49class Job {
50private:
51protected:
52 // make const
55 std::shared_ptr<Potential> pot;
56
57public:
58 Job(std::unique_ptr<Parameters> parameters)
59 : jtype{parameters->main_options.job},
60 params{*std::move(parameters)},
61 pot{helpers::makePotential(params.potential_options.potential,
62 params)} {}
63 Job(std::shared_ptr<Potential> potPassed, const Parameters &parameters)
64 : jtype{parameters.main_options.job},
65 params{parameters},
66 pot{potPassed} {}
67 virtual ~Job() = default;
69 virtual std::vector<std::string> run() = 0;
70 [[nodiscard]] JobType getType() { return this->jtype; };
71};
72
73namespace helpers {
74std::unique_ptr<Job> makeJob(std::unique_ptr<Parameters> params);
75} // namespace helpers
76
77} // namespace eonc
78
79using eonc::Job;
Declaration of job class.
Definition Job.h:49
virtual ~Job()=default
Job(std::unique_ptr< Parameters > parameters)
Definition Job.h:58
JobType getType()
Definition Job.h:70
Job(std::shared_ptr< Potential > potPassed, const Parameters &parameters)
Definition Job.h:63
JobType jtype
Definition Job.h:53
std::shared_ptr< Potential > pot
Definition Job.h:55
Parameters params
Definition Job.h:54
virtual std::vector< std::string > run()=0
Virtual run; used solely for dynamic dispatch.
std::unique_ptr< Job > makeJob(std::unique_ptr< Parameters > params)
Definition Job.cpp:39
RAII resource manager for the ARTn C library with global synchronization.