#include "src/settings/ArgumentTypeInferationHelper.h" namespace storm { namespace settings { template ArgumentType inferToEnumType() { STORM_LOG_THROW(false, storm::exceptions::InternalTypeErrorException, "Unable to infer type of argument."); } template <> ArgumentType inferToEnumType() { return ArgumentType::String; } template <> ArgumentType inferToEnumType() { return ArgumentType::Integer; } template <> ArgumentType inferToEnumType() { return ArgumentType::UnsignedInteger; } template <> ArgumentType inferToEnumType() { return ArgumentType::Double; } template <> ArgumentType inferToEnumType() { return ArgumentType::Boolean; } template std::string const& inferToString(ArgumentType const& argumentType, T const& value) { STORM_LOG_THROW(false, storm::exceptions::InternalTypeErrorException, "Unable to infer string from non-string argument value."); } template <> std::string const& inferToString(ArgumentType const& argumentType, std::string const& value) { STORM_LOG_THROW(argumentType == ArgumentType::String, storm::exceptions::InternalTypeErrorException, "Unable to infer string from non-string argument."); return value; } template int_fast64_t inferToInteger(ArgumentType const& argumentType, T const& value) { STORM_LOG_THROW(false, storm::exceptions::InternalTypeErrorException, "Unable to infer integer from non-integer argument value."); } template <> int_fast64_t inferToInteger(ArgumentType const& argumentType, int_fast64_t const& value) { STORM_LOG_THROW(argumentType == ArgumentType::Integer, storm::exceptions::InternalTypeErrorException, "Unable to infer integer from non-integer argument."); return value; } template uint_fast64_t inferToUnsignedInteger(ArgumentType const& argumentType, T const& value) { STORM_LOG_THROW(false, storm::exceptions::InternalTypeErrorException, "Unable to infer unsigned integer from non-unsigned argument value."); } template <> uint_fast64_t inferToUnsignedInteger(ArgumentType const& argumentType, uint_fast64_t const& value) { STORM_LOG_THROW(argumentType == ArgumentType::UnsignedInteger, storm::exceptions::InternalTypeErrorException, "Unable to infer integer from non-integer argument."); return value; } template double inferToDouble(ArgumentType const& argumentType, T const& value) { STORM_LOG_THROW(false, storm::exceptions::InternalTypeErrorException, "Unable to infer double from non-double argument value."); } template <> double inferToDouble(ArgumentType const& argumentType, double const& value) { STORM_LOG_THROW(argumentType == ArgumentType::Double, storm::exceptions::InternalTypeErrorException, "Unable to infer double from non-double argument."); return value; } template bool inferToBoolean(ArgumentType const& argumentType, T const& value) { STORM_LOG_THROW(false, storm::exceptions::InternalTypeErrorException, "Unable to infer boolean from non-boolean argument value."); } template <> bool inferToBoolean(ArgumentType const& argumentType, bool const& value) { STORM_LOG_THROW(argumentType == ArgumentType::Boolean, storm::exceptions::InternalTypeErrorException, "Unable to infer boolean from non-boolean argument."); return value; } // Explicitly instantiate the templates. template ArgumentType inferToEnumType(); template ArgumentType inferToEnumType(); template ArgumentType inferToEnumType(); template ArgumentType inferToEnumType(); template ArgumentType inferToEnumType(); template std::string const& inferToString(ArgumentType const& argumentType, std::string const& value); template std::string const& inferToString(ArgumentType const& argumentType, int_fast64_t const& value); template std::string const& inferToString(ArgumentType const& argumentType, uint_fast64_t const& value); template std::string const& inferToString(ArgumentType const& argumentType, double const& value); template std::string const& inferToString(ArgumentType const& argumentType, bool const& value); template int_fast64_t inferToInteger(ArgumentType const& argumentType, std::string const& value); template int_fast64_t inferToInteger(ArgumentType const& argumentType, int_fast64_t const& value); template int_fast64_t inferToInteger(ArgumentType const& argumentType, uint_fast64_t const& value); template int_fast64_t inferToInteger(ArgumentType const& argumentType, double const& value); template int_fast64_t inferToInteger(ArgumentType const& argumentType, bool const& value); template uint_fast64_t inferToUnsignedInteger(ArgumentType const& argumentType, std::string const& value); template uint_fast64_t inferToUnsignedInteger(ArgumentType const& argumentType, int_fast64_t const& value); template uint_fast64_t inferToUnsignedInteger(ArgumentType const& argumentType, uint_fast64_t const& value); template uint_fast64_t inferToUnsignedInteger(ArgumentType const& argumentType, double const& value); template uint_fast64_t inferToUnsignedInteger(ArgumentType const& argumentType, bool const& value); template double inferToDouble(ArgumentType const& argumentType, std::string const& value); template double inferToDouble(ArgumentType const& argumentType, int_fast64_t const& value); template double inferToDouble(ArgumentType const& argumentType, uint_fast64_t const& value); template double inferToDouble(ArgumentType const& argumentType, double const& value); template double inferToDouble(ArgumentType const& argumentType, bool const& value); template bool inferToBoolean(ArgumentType const& argumentType, std::string const& value); template bool inferToBoolean(ArgumentType const& argumentType, int_fast64_t const& value); template bool inferToBoolean(ArgumentType const& argumentType, uint_fast64_t const& value); template bool inferToBoolean(ArgumentType const& argumentType, double const& value); template bool inferToBoolean(ArgumentType const& argumentType, bool const& value); } }