solver  1.0
Classes | Functions
Exceptions.h File Reference

The file defines extended exceptions for the better error handling in the program. More...

#include <algorithm>
#include <iterator>
#include <stdexcept>
#include <string>
#include <vector>
#include <stdint.h>
+ Include dependency graph for Exceptions.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SolverException
 A general exception of the program. More...
 
class  InvalidDatasetFile
 Thrown if the dataset file contains ill-specified robotic cells. More...
 
class  InvalidArgument
 Exception is thrown if a method is given invalid parameters or a user provides invalid program arguments. More...
 
class  ILPSolverException
 Exception dedicated to problems with Integer Linear Programming solvers. More...
 
class  NoFeasibleSolutionExists
 Thrown if no feasible solution is found by the heuristic. More...
 
class  EmptySolutionPool
 Thrown if the best solution of the heuristic cannot be returned since the solution pool is empty. More...
 

Functions

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"}. More...
 
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". More...
 
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-exceptions. More...
 

Detailed Description

The file defines extended exceptions for the better error handling in the program.

Author
Libor Bukata

Definition in file Exceptions.h.

Function Documentation

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".

Parameters
toConcatVector of strings to concatenate.
beforeItemString prepended to each string in toConcat.
afterItemString appended to each string in toConcat with exception of the last one.
Returns
Concatenation of the strings including additional parts.

Definition at line 34 of file Exceptions.cpp.

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-exceptions.

Parameters
eException to be printed to string.
levelCurrent level of indentation.
Returns
A fully formatted error message for the given exception, including nested exceptions.

Definition at line 49 of file Exceptions.cpp.

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"}.

Parameters
toSplitString to be split.
delimDelimiter used for splitting.
Returns
Vector of strings split by the delimiter.

Definition at line 24 of file Exceptions.cpp.