18 #ifndef HLIDAC_PES_EXCEPTIONS_H
19 #define HLIDAC_PES_EXCEPTIONS_H
40 std::vector<std::string>
split(
const std::string& toSplit,
const char& delim);
49 std::string
concat(
const std::vector<std::string>& toConcat,
const std::string& beforeItem,
const std::string& afterItem);
67 std::vector<std::string> splitCaller =
split(caller,
'\n'), splitMsg =
split(msg,
'\n');
68 std::copy(splitCaller.cbegin(), splitCaller.cend(), std::back_inserter(
mWhat));
69 std::copy(splitMsg.cbegin(), splitMsg.cend(), std::back_inserter(
mWhat));
74 virtual const char*
what()
const throw() {
return mWhatStr.c_str(); }
80 virtual std::string
whatIndented(uint32_t level = 0)
const throw() {
81 return concat(
mWhat, std::string(level,
'\t'),
"\n");
110 mWhat.push_back(
"The error occured around the line "+std::to_string(
mLineNumber)+
" in the input dataset file!");
std::string mWhatStr
The formated error message without an indentation.
virtual ~SolverException()
Virtual destructor is mandatory due to the polymorphism.
InvalidDatasetFile(const std::string &caller, const std::string &msg, int64_t lineNumber=-1)
Constructs a specialized exception for error handling of ill-specified datasets.
std::string exceptionToString(const std::exception &e, uint32_t level=0)
The recursive method creates the formatted error message for the given exception and their nested sub...
A general exception of the program.
Thrown if the dataset file contains ill-specified robotic cells.
std::vector< std::string > split(const std::string &toSplit, const char &delim)
It splits the input string, e.g. split("abc ab c", ' ') -> {"abc", "ab", "c"}.
Exception is thrown if a method is given invalid parameters or a user provides invalid program argume...
Exception dedicated to problems with Integer Linear Programming solvers.
Thrown if no feasible solution is found by the heuristic.
std::vector< std::string > mWhat
Individual lines of the error message.
int64_t mLineNumber
Error occurred at this line in the XML file.
virtual std::string whatIndented(uint32_t level=0) const
Virtual function returning the formatted error message.
SolverException(const std::string &caller, const std::string &msg)
Constructs the exception, it comprises building of the error string and vector of lines...
std::string concat(const std::vector< std::string > &toConcat, const std::string &beforeItem, const std::string &afterItem)
Method concatenates the given strings, e.g. concat({"abc", "ab"}, "\t", "\n") -> "\tabc\n\tab".
virtual const char * what() const
Virtual method returns the error message without an indentation.
Thrown if the best solution of the heuristic cannot be returned since the solution pool is empty...