1 #ifndef ZSERIO_CPP_RUNTIME_EXCEPTION_H_INC
2 #define ZSERIO_CPP_RUNTIME_EXCEPTION_H_INC
44 const char*
what() const noexcept override;
51 void append(const
char* message);
59 void append(const
char* message,
size_t messageLen);
62 void appendImpl(
std::string_view message);
64 std::array<
char, 512> m_buffer;
126 template <typename T, typename
std::enable_if<
std::is_integral<T>::value,
int>::type = 0>
129 std::array<char, 24> buffer = {};
131 return exception << stringValue;
142 template <
typename ALLOC>
144 CppRuntimeException& exception,
const std::basic_string<
char, std::char_traits<char>, ALLOC>& value)
146 exception.
append(value.c_str(), value.size());
158 template <
typename T,
typename ALLOC>
161 return exception <<
"vector([...], " << value.size() <<
")";
172 template <
typename EXCEPTION,
typename VALUE,
173 typename =
typename std::enable_if<std::is_base_of<CppRuntimeException, EXCEPTION>::value,
int>::type>
174 using CppRuntimeExceptionRValueInsertion = EXCEPTION&&;
189 template <
typename CPP_RUNTIME_EXCEPTION,
typename T>
190 detail::CppRuntimeExceptionRValueInsertion<CPP_RUNTIME_EXCEPTION, T>
operator<<(
191 CPP_RUNTIME_EXCEPTION&& exception,
const T& value)
194 return std::forward<CPP_RUNTIME_EXCEPTION>(exception);
CppRuntimeException & operator=(const CppRuntimeException &other)=default
CppRuntimeException(CppRuntimeException &&other)=default
CppRuntimeException(const CppRuntimeException &other)=default
const char * what() const noexcept override
CppRuntimeException & operator=(CppRuntimeException &&other)=default
~CppRuntimeException() override=default
CppRuntimeException(const char *message="")
void append(const char *message)
const char * convertIntToString(std::array< char, 24 > &buffer, T value)
CppRuntimeException & operator<<(CppRuntimeException &exception, const BasicBitBuffer< ALLOC > &bitBuffer)