From 609a94849555a5810a941e802ba4dfbd1863ddd3 Mon Sep 17 00:00:00 2001 From: dehnert Date: Fri, 28 Nov 2014 00:02:48 +0100 Subject: [PATCH 1/2] Put noexcept in Macro and use deprecated throw() for MSVC to make it happy. Former-commit-id: 3d83fefcdac0e67be549c81bb05188729dbff178 --- src/exceptions/BaseException.cpp | 2 +- src/exceptions/BaseException.h | 4 +++- src/utility/OsDetection.h | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/exceptions/BaseException.cpp b/src/exceptions/BaseException.cpp index ed28a918c..45f4a9bf8 100644 --- a/src/exceptions/BaseException.cpp +++ b/src/exceptions/BaseException.cpp @@ -18,7 +18,7 @@ namespace storm { // Intentionally left empty. } - const char* BaseException::what() const noexcept { + const char* BaseException::what() const NOEXCEPT { std::string errorString = this->stream.str(); char* result = new char[errorString.size() + 1]; result[errorString.size()] = '\0'; diff --git a/src/exceptions/BaseException.h b/src/exceptions/BaseException.h index aae0b208a..cfb97580d 100644 --- a/src/exceptions/BaseException.h +++ b/src/exceptions/BaseException.h @@ -4,6 +4,8 @@ #include #include +#include "utility/OsDetection.h" + namespace storm { namespace exceptions { @@ -39,7 +41,7 @@ namespace storm { * * @return The message associated with this exception. */ - virtual const char* what() const noexcept; + virtual const char* what() const NOEXCEPT override; protected: // This stream stores the message of this exception. diff --git a/src/utility/OsDetection.h b/src/utility/OsDetection.h index 37be3f0e7..d91d5595e 100644 --- a/src/utility/OsDetection.h +++ b/src/utility/OsDetection.h @@ -3,6 +3,7 @@ #if defined __linux__ || defined __linux # define LINUX +# define NOEXCEPT noexcept # include # include #include // Required by ErrorHandling.h @@ -12,6 +13,7 @@ # define GetCurrentDir getcwd #elif defined TARGET_OS_MAC || defined __apple__ || defined __APPLE__ # define MACOSX +# define NOEXCEPT noexcept # define _DARWIN_USE_64_BIT_INODE # include # include @@ -22,6 +24,7 @@ # define GetCurrentDir getcwd #elif defined _WIN32 || defined _WIN64 # define WINDOWS +# define NOEXCEPT throw() # ifndef NOMINMAX # define NOMINMAX # undef min From 5676d990c4ad93eddefb8eaf152d0e92694d2b3c Mon Sep 17 00:00:00 2001 From: dehnert Date: Fri, 28 Nov 2014 11:14:55 +0100 Subject: [PATCH 2/2] APs true/false can now be queried for a state. Former-commit-id: 0157e033403dabffe6ebe2e735e4a5fa21af9468 --- src/models/AtomicPropositionsLabeling.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/models/AtomicPropositionsLabeling.h b/src/models/AtomicPropositionsLabeling.h index 6281c5d6b..c7c3912a6 100644 --- a/src/models/AtomicPropositionsLabeling.h +++ b/src/models/AtomicPropositionsLabeling.h @@ -209,9 +209,14 @@ public: * @return True if the node is labeled with the atomic proposition, false otherwise. */ bool getStateHasAtomicProposition(std::string const& ap, const uint_fast64_t state) const { + if (ap == "true") { + return true; + } else if (ap == "false") { + return false; + } if (!this->containsAtomicProposition(ap)) { - LOG4CPLUS_ERROR(logger, "The atomic proposition " << ap << " is invalid for the labeling of the model."); - throw storm::exceptions::InvalidArgumentException() << "The atomic proposition " << ap << " is invalid for the labeling of the model."; + LOG4CPLUS_ERROR(logger, "The atomic proposition '" << ap << "' is invalid for the labeling of the model."); + throw storm::exceptions::InvalidArgumentException() << "The atomic proposition '" << ap << "' is invalid for the labeling of the model."; } auto apIndexPair = nameToLabelingMap.find(ap); return this->singleLabelings[apIndexPair->second].get(state);