1 #ifndef ZSERIO_CPP_RUNTIME_EXCEPTION_H_INC 2 #define ZSERIO_CPP_RUNTIME_EXCEPTION_H_INC 45 const char*
what()
const noexcept
override;
52 void append(
const char* message);
60 void append(
const char* message,
size_t messageLen);
65 std::array<char, 512> m_buffer;
117 template <typename T, typename std::enable_if<std::is_integral<T>::value,
int>::type = 0>
120 std::array<char, 24> buffer = {};
122 return exception << stringValue;
133 template <typename T, typename std::enable_if<is_bitmask<T>::value,
int>::type = 0>
136 exception << value.getValue();
148 template <
typename ALLOC>
150 const std::basic_string<
char, std::char_traits<char>, ALLOC>& value)
152 exception.
append(value.c_str(), value.size());
164 template <
typename T,
typename ALLOC>
167 return exception <<
"vector([...], " << value.size() <<
")";
174 template <
typename EXCEPTION,
typename VALUE,
175 typename =
typename std::enable_if<std::is_base_of<CppRuntimeException, EXCEPTION>::value,
int>::type,
176 typename = decltype(std::declval<EXCEPTION&>() << std::declval<const VALUE&>())>
177 using CppRuntimeExceptionRValueInsertion = EXCEPTION&&;
192 template <
typename CPP_RUNTIME_EXCEPTION,
typename T>
193 detail::CppRuntimeExceptionRValueInsertion<CPP_RUNTIME_EXCEPTION, T>
194 operator<<(CPP_RUNTIME_EXCEPTION&& exception,
const T& value)
197 return std::forward<CPP_RUNTIME_EXCEPTION>(exception);
202 #endif // ifndef ZSERIO_CPP_RUNTIME_EXCEPTION_H_INC
const char * what() const noexceptoverride
const char * convertIntToString(std::array< char, 24 > &buffer, T value)
~CppRuntimeException() override=default
void append(const char *message)
CppRuntimeException & operator=(const CppRuntimeException &other)=default
CppRuntimeException(const char *message="")
CppRuntimeException & operator<<(CppRuntimeException &exception, const BasicBitBuffer< ALLOC > &bitBuffer)