Browse Source

Merge branch 'master' into parametricSystems

Former-commit-id: 7b7c64fda4
tempestpy_adaptions
dehnert 10 years ago
parent
commit
aebb1e65e0
  1. 2
      src/exceptions/BaseException.cpp
  2. 4
      src/exceptions/BaseException.h
  3. 9
      src/models/AtomicPropositionsLabeling.h
  4. 3
      src/utility/OsDetection.h

2
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';

4
src/exceptions/BaseException.h

@ -4,6 +4,8 @@
#include <exception>
#include <sstream>
#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.

9
src/models/AtomicPropositionsLabeling.h

@ -242,9 +242,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);

3
src/utility/OsDetection.h

@ -3,6 +3,7 @@
#if defined __linux__ || defined __linux
# define LINUX
# define NOEXCEPT noexcept
# include <sys/mman.h>
# include <unistd.h>
#include <execinfo.h> // 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 <sys/mman.h>
# include <unistd.h>
@ -22,6 +24,7 @@
# define GetCurrentDir getcwd
#elif defined _WIN32 || defined _WIN64
# define WINDOWS
# define NOEXCEPT throw()
# ifndef NOMINMAX
# define NOMINMAX
# undef min

Loading…
Cancel
Save