From 6b166952e88bf60c23f13913dbe918c4145d76df Mon Sep 17 00:00:00 2001 From: sjunges Date: Wed, 24 Feb 2016 16:33:20 +0100 Subject: [PATCH] output operators for element type Former-commit-id: 8298f03f5e0c260394d1eeb542289e100d053ba9 --- src/storage/dft/DFTElementType.h | 36 +++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/src/storage/dft/DFTElementType.h b/src/storage/dft/DFTElementType.h index d4bf3bfc2..8b8035d45 100644 --- a/src/storage/dft/DFTElementType.h +++ b/src/storage/dft/DFTElementType.h @@ -6,7 +6,6 @@ namespace storm { enum class DFTElementType : int {AND = 0, OR = 2, VOT = 3, BE = 4, CONSTF = 5, CONSTS = 6, PAND = 7, SPARE = 8, POR = 9, PDEP = 10, SEQ = 11, MUTEX=12}; - inline bool isGateType(DFTElementType const& tp) { switch(tp) { case DFTElementType::AND: @@ -29,7 +28,6 @@ namespace storm { } } - inline bool isStaticGateType(DFTElementType const& tp) { if(!isGateType(tp)) return false; switch(tp) { @@ -46,7 +44,39 @@ namespace storm { return false; } } - + + inline std::string toString(DFTElementType const& tp) { + switch(tp) { + case DFTElementType::BE: + return "BE"; + case DFTElementType::OR: + return "OR"; + case DFTElementType::AND: + return "AND"; + case DFTElementType::VOT: + return "VOT"; + case DFTElementType::POR: + return "POR"; + case DFTElementType::PAND: + return "PAND"; + case DFTElementType::SPARE: + return "SPARE"; + case DFTElementType::SEQ: + return "SEQ"; + case DFTElementType::MUTEX: + return "MUTEX"; + case DFTElementType::PDEP: + return "PDEP"; + default: + assert(false); + } + } + + inline std::ostream& operator<<(std::ostream& os, DFTElementType const& tp) { + return os << toString(tp) << std::endl; + } + + } }