Browse Source

Merge branch 'master' of https://sselab.de/lab9/private/git/MRMC

tempestpy_adaptions
dehnert 12 years ago
parent
commit
d34c39293e
  1. 5
      src/exceptions/BaseException.h
  2. 2
      src/exceptions/InvalidSettings.h
  3. 2
      src/mrmc.cpp

5
src/exceptions/BaseException.h

@ -7,6 +7,7 @@
namespace mrmc {
namespace exceptions {
template<typename E>
class BaseException : public std::exception
{
public:
@ -19,10 +20,10 @@ class BaseException : public std::exception
~BaseException() throw() { }
template<class T>
BaseException& operator<<(const T& var)
E& operator<<(const T& var)
{
this->stream << var;
return *this;
return * dynamic_cast<E*>(this);
}
virtual const char* what() const throw()

2
src/exceptions/InvalidSettings.h

@ -6,7 +6,7 @@
namespace mrmc {
namespace exceptions {
class InvalidSettings : public BaseException
class InvalidSettings : public BaseException<InvalidSettings>
{
};

2
src/mrmc.cpp

@ -76,7 +76,7 @@ int main(const int argc, const char* argv[]) {
try {
mrmc::settings::Settings::registerModule<mrmc::modelChecker::GmmxxDtmcPrctlModelChecker<double> >();
s = mrmc::settings::newInstance(argc, argv, nullptr);
} catch (mrmc::exceptions::InvalidSettings& e) {
} catch (mrmc::exceptions::InvalidSettings e) {
LOG4CPLUS_FATAL(logger, "InvalidSettings error: " << e.what());
LOG4CPLUS_FATAL(logger, "Could not recover from settings error, terminating.");
std::cout << "Could not recover from settings error: " << e.what() << std::endl;

Loading…
Cancel
Save