VPTissue Reference Manual
CliSimulationTask.h
Go to the documentation of this file.
1 #ifndef CLI_TASK_H_
2 #define CLI_TASK_H_
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include <iomanip>
23 #include <iostream>
24 #include <string>
25 
26 namespace SimPT_Shell {
27 
32 {
33 public:
35  CliSimulationTask(const std::string& project, bool input_file_set = false,
36  const std::string& input_file = "",
37  bool num_steps_set = false, unsigned int num_steps = 0)
38  : m_input_file(input_file), m_input_file_set(input_file_set),
39  m_num_steps(num_steps), m_num_steps_set(num_steps_set),
40  m_project_name(project)
41  {
42  }
43 
45  const std::string GetLeaf() const { return m_input_file; }
46 
48  unsigned int GetNumSteps() const { return m_num_steps; }
49 
51  const std::string GetProjectName() const {return m_project_name; }
52 
54  bool IsLeafSet() const {return m_input_file_set; }
55 
57  bool IsNumStepsSet() const { return m_num_steps_set; }
58 
59 private:
60  std::string m_input_file;
61  bool m_input_file_set;
62  unsigned int m_num_steps;
63  bool m_num_steps_set;
64  std::string m_project_name;
65 };
66 
67 inline
68 std::ostream& operator<<(std::ostream& os, const CliSimulationTask& task)
69 {
70  os << "CliTask: project = " << task.GetProjectName() << std::endl
71  << " is_input_file_set = " << std::boolalpha << task.IsLeafSet()
72  << ", input_file = " << task.GetLeaf() << std::endl
73  << " is_num_steps_set = " << std::boolalpha << task.IsNumStepsSet()
74  << ", number of steps = " << task.GetNumSteps();
75 
76  return os;
77 }
78 
79 } // namespace
80 
81 #endif // include guard
bool IsLeafSet() const
Plain getter.
const std::string GetProjectName() const
Plain getter.
Namespace for SimPT shell package.
Definition: Client.cpp:50
const std::string GetLeaf() const
Plain getter.
unsigned int GetNumSteps() const
Plain getter.
A CliTask represents an invocation of the program from the command line.
CliSimulationTask(const std::string &project, bool input_file_set=false, const std::string &input_file="", bool num_steps_set=false, unsigned int num_steps=0)
Straight constructor.