27#include <platform.hpp>
33using namespace std::literals;
70 template<
typename StatusType,
typename ResultT, StringLiteral ResultTName>
98 std::vector<std::string> _out,
111 [[nodiscard(
"Output should be used")]] std::string
getOutput(
size_t idx = 0)
const
122 [[nodiscard(
"Inputs should be used")]] std::vector<std::string>
getInputs()
const {
return inputs; }
126 template<
typename ResultT>
130 template<
typename ResultT>
A base class for a result of a calculation. You should use the Result and ResultBool aliases instead ...
Definition result.hpp:72
ResultT getResult() const
Definition result.hpp:108
std::vector< std::string > inputs
Definition result.hpp:77
StatusType getStatus() const
Gets how the calculation is done.
Definition result.hpp:106
Status done
Definition result.hpp:74
ResultT result
Definition result.hpp:84
std::vector< std::string > getInputs() const
Gets the inputs to the calculation.
Definition result.hpp:122
ResultBase(const std::vector< std::string > &_inputs, std::vector< std::string > _out, ResultT result, StatusType _done)
Constructs a new result object.
Definition result.hpp:97
std::string getOutput(size_t idx=0) const
Gets the output of the calculation.
Definition result.hpp:111
std::vector< std::string > outputs
Definition result.hpp:80
The namespace containing utility functions for the Steppable library.
Definition argParse.cpp:40
void programSafeExit(const int status)
Exit the program safely.
Definition platform.hpp:61
void error(const std::string &name, const std::basic_string< T > &msg, const std::vector< std::string > &args={})
Prints an error message.
Definition output.hpp:80
The namespace containing types used in the steppable calculator.
ResultBase< StatusBool, ResultT, StringLiteral{ "bool" }> ResultBool
An alias for a result of a boolean calculation.
Definition result.hpp:131
ResultBase< Status, ResultT, StringLiteral{ "str" }> Result
An alias for a result of a calculation. This represents a calculation with a Status status.
Definition result.hpp:127
Status
The status of the calculation.
Definition result.hpp:46
@ MATH_ERROR
The calculation is not done because of an error.
Definition result.hpp:49
@ CALCULATED_UNSIMPLIFIED
The calculation is done.
Definition result.hpp:48
@ CALCULATED_SIMPLIFIED
The calculation is done by taking simplified steps.
Definition result.hpp:47
StatusBool
The status of a boolean calculation.
Definition result.hpp:56
@ CALCULATED_UNSIMPLIFIED_YES
The calculation is done, the result it True.
Definition result.hpp:59
@ CALCULATED_SIMPLIFIED_NO
The calculation is done by taking simplified steps, the result it False.
Definition result.hpp:58
@ CALCULATED_UNSIMPLIFIED_NO
The calculation is done, the result it False.
Definition result.hpp:60
@ CALCULATED_SIMPLIFIED_YES
The calculation is done by taking simplified steps, the result it True.
Definition result.hpp:57
String literal workaround for templates.
Definition util.hpp:228