From a7ff22bd494fb52c5a53d069a87cefe8c457e075 Mon Sep 17 00:00:00 2001 From: sjunges Date: Tue, 13 Sep 2016 23:57:21 +0200 Subject: [PATCH] Added to_string for ModelType Former-commit-id: e1cf7467274f8e91757acbee47637145ba47b2e0 [formerly 912ca0f4f382a1f343c4a0f75208ceb2441355d5] Former-commit-id: 9ebb580890aaff7ac077374fa3dc78b5f46139f7 --- src/storage/jani/ModelType.cpp | 44 +++++++++++++--------------------- src/storage/jani/ModelType.h | 1 + 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/storage/jani/ModelType.cpp b/src/storage/jani/ModelType.cpp index c1cad45d2..460145340 100644 --- a/src/storage/jani/ModelType.cpp +++ b/src/storage/jani/ModelType.cpp @@ -4,48 +4,38 @@ namespace storm { namespace jani { std::ostream& operator<<(std::ostream& stream, ModelType const& type) { + return stream << to_string(type); + } + + std::string to_string(ModelType const& type) { switch (type) { case ModelType::UNDEFINED: - stream << "undefined"; - break; + return "undefined"; case ModelType::LTS: - stream << "lts"; - break; + return "lts"; case ModelType::DTMC: - stream << "dtmc"; - break; + return "dtmc"; case ModelType::CTMC: - stream << "ctmc"; - break; + return "ctmc"; case ModelType::MDP: - stream << "mdp"; - break; + return "mdp"; case ModelType::CTMDP: - stream << "ctmdp"; - break; + return "ctmdp"; case ModelType::MA: - stream << "ma"; - break; + return "ma"; case ModelType::TA: - stream << "ta"; - break; + return "ta"; case ModelType::PTA: - stream << "pta"; - break; + return "pta"; case ModelType::STA: - stream << "sta"; - break; + return "sta"; case ModelType::HA: - stream << "ha"; - break; + return "ha"; case ModelType::PHA: - stream << "pha"; - break; + return "pha"; case ModelType::SHA: - stream << "sha"; - break; + return "sha"; } - return stream; } ModelType getModelType(std::string const& input) { diff --git a/src/storage/jani/ModelType.h b/src/storage/jani/ModelType.h index 7bee93e8c..c8a906d6c 100644 --- a/src/storage/jani/ModelType.h +++ b/src/storage/jani/ModelType.h @@ -10,6 +10,7 @@ namespace storm { HA = 10, PHA = 11, SHA = 12}; ModelType getModelType(std::string const& input); + std::string to_string(ModelType const& type); std::ostream& operator<<(std::ostream& stream, ModelType const& type); }