#ifndef STORM_SETTINGS_ARGUMENTTYPEINFERATIONHELPER_H_ #define STORM_SETTINGS_ARGUMENTTYPEINFERATIONHELPER_H_ #include #include #include "src/settings/ArgumentType.h" #include "src/utility/macros.h" #include "src/exceptions/InternalTypeErrorException.h" namespace storm { namespace settings { /*! * This function infers the type in our enum of possible types from the template parameter. * * @return The argument type that has been inferred. */ template ArgumentType inferToEnumType(); // Specialized function templates that allow casting the given value to the correct type. If the conversion // fails, an exception is thrown. template std::string const& inferToString(ArgumentType const& argumentType, T const& value); template <> std::string const& inferToString(ArgumentType const& argumentType, std::string const& value); template int_fast64_t inferToInteger(ArgumentType const& argumentType, T const& value); template <> int_fast64_t inferToInteger(ArgumentType const& argumentType, int_fast64_t const& value); template uint_fast64_t inferToUnsignedInteger(ArgumentType const& argumentType, T const& value); template <> uint_fast64_t inferToUnsignedInteger(ArgumentType const& argumentType, uint_fast64_t const& value); template double inferToDouble(ArgumentType const& argumentType, T const& value); template <> double inferToDouble(ArgumentType const& argumentType, double const& value); template bool inferToBoolean(ArgumentType const& argumentType, T const& value); template <> bool inferToBoolean(ArgumentType const& argumentType, bool const& value); } // namespace settings } // namespace storm #endif // STORM_SETTINGS_ARGUMENTTYPEINFERATIONHELPER_H_