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);
63 void appendImpl(
Span<const
char> message);
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 CppRuntimeException& exception,
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() <<
")";
178 template <
typename EXCEPTION,
typename VALUE,
179 typename =
typename std::enable_if<std::is_base_of<CppRuntimeException, EXCEPTION>::value,
int>::type>
180 using CppRuntimeExceptionRValueInsertion = EXCEPTION&&;
195 template <
typename CPP_RUNTIME_EXCEPTION,
typename T>
196 detail::CppRuntimeExceptionRValueInsertion<CPP_RUNTIME_EXCEPTION, T>
operator<<(
197 CPP_RUNTIME_EXCEPTION&& exception,
const T& value)
200 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)