This repository has been archived on 2023-07-19. You can view files and clone it, but cannot push or open issues or pull requests.
2016-05-30 20:43:36 +02:00
|
|
|
#ifndef __PLASP__PDDL__CONSISTENCY_EXCEPTION_H
|
|
|
|
#define __PLASP__PDDL__CONSISTENCY_EXCEPTION_H
|
|
|
|
|
|
|
|
#include <exception>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace plasp
|
|
|
|
{
|
|
|
|
namespace pddl
|
|
|
|
{
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// ConsistencyException
|
|
|
|
//
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
class ConsistencyException: public std::exception
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit ConsistencyException()
|
2016-06-14 16:53:48 +02:00
|
|
|
: ConsistencyException("unspecified consistency error")
|
2016-05-30 20:43:36 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
explicit ConsistencyException(const char *message)
|
|
|
|
: ConsistencyException(static_cast<std::string>(message))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
explicit ConsistencyException(const std::string &message)
|
|
|
|
: m_message{message}
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
~ConsistencyException() throw()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
const char *what() const throw()
|
|
|
|
{
|
|
|
|
if (m_message.empty())
|
2016-06-14 16:53:48 +02:00
|
|
|
return "unspecified consistency error";
|
2016-05-30 20:43:36 +02:00
|
|
|
|
|
|
|
return m_message.c_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string m_message;
|
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|