12#ifndef RTCTK_COMPONENTFRAMEWORK_EXCEPTIONS_HPP
13#define RTCTK_COMPONENTFRAMEWORK_EXCEPTIONS_HPP
17#include <ciiBasicDataType.hpp>
18#include <ciiException.hpp>
28#ifdef CII_MAKE_EXCEPTION
29#undef CII_MAKE_EXCEPTION
31#define CII_MAKE_EXCEPTION(exceptionType_t, ...) \
32 ::error::elt::details::CreateExceptionObject<exceptionType_t>( \
33 0, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
37#ifdef CII_MAKE_EXCEPTION_WITH_NESTED
38#undef CII_MAKE_EXCEPTION_WITH_NESTED
40#define CII_MAKE_EXCEPTION_WITH_NESTED(exceptionType_t, nested_exception, ...) \
41 ::error::elt::details::CreateExceptionObject<exceptionType_t>( \
42 nested_exception, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
59 requires std::constructible_from<T, E>
61 : T(
std::forward<E>(e)) {
71 std::string_view lines,
72 std::string_view initial_indent,
73 std::string_view subsequent_indent);
97 std::is_nothrow_constructible_v<detail::UnspecifiedNested<typename std::decay_t<E>>, E&&>) {
98 using Type =
typename std::decay_t<E>;
99 static_assert(std::is_class_v<Type>,
"exception must be a non-union class-type");
174 : m_ptr(), m_exception(&exception) {};
179 : m_ptr(std::move(ptr)), m_exception(
nullptr) {};
187 std::stringstream ss;
202 }
else if (printer.m_exception) {
211 std::exception_ptr m_ptr;
212 const std::exception* m_exception;
280 explicit BufferTooSmall(
const std::size_t actual,
const std::size_t expected);
289 const std::size_t expected,
290 const std::string& reason);
InvalidArgumentException(const std::string &message)
Definition exceptions.cpp:179
AdapterCreationException(const std::string &interface_name)
Definition exceptions.cpp:191
std::size_t m_actual
Definition exceptions.hpp:300
std::size_t GetActualBufferSize() const
Definition exceptions.hpp:292
std::size_t m_expected
Definition exceptions.hpp:301
BufferTooSmall(const std::size_t actual, const std::size_t expected)
Construct exception object.
Definition exceptions.cpp:158
std::size_t GetExpectedBufferSize() const
Definition exceptions.hpp:295
RtctkException() noexcept
Definition exceptions.cpp:112
DdtError(const std::string &message)
Definition exceptions.hpp:379
RtctkException() noexcept
Definition exceptions.cpp:112
DdtSinkNotFound(const std::string &message)
Definition exceptions.hpp:364
InitialisationException(const std::string &message)
Definition exceptions.cpp:185
InvalidArgumentException(const std::string &message)
Definition exceptions.cpp:179
InvalidSetting(const std::string &message)
Definition exceptions.hpp:350
RtctkException() noexcept
Definition exceptions.cpp:112
InvalidStateChange(const std::string &message)
Definition exceptions.hpp:336
RtctkException() noexcept
Definition exceptions.cpp:112
RtctkException() noexcept
Definition exceptions.cpp:112
IpcqError(const std::string &message)
Definition exceptions.hpp:394
std::string Str() const
Convenience function for constructing a std::string from the exception.
Definition exceptions.hpp:186
NestedExceptionPrinter(const std::exception &exception) noexcept
Construct from exception derived from std::exception.
Definition exceptions.hpp:173
NestedExceptionPrinter(std::exception_ptr ptr) noexcept
Construct from exception_ptr.
Definition exceptions.hpp:178
friend std::ostream & operator<<(std::ostream &os, const NestedExceptionPrinter &printer)
Formats exception from printer using PrintNestedExceptions.
Definition exceptions.hpp:199
NotImplementedException(const std::string &feature)
Definition exceptions.cpp:123
RtctkException() noexcept
Definition exceptions.cpp:112
~RtctkException() override=default
RtctkException(const RtctkException &other) noexcept
UnsupportedTypeException(const std::string &type)
Definition exceptions.cpp:130
UnsupportedUriException(const elt::mal::Uri &uri)
Definition exceptions.cpp:147
Project-wide configuration header.
#define RTCTK_API
Helper to indicate that a class or function must be exported in the public symbol table.
Definition config.hpp:32
void PrintNestedExceptions(std::ostream &os, const std::exception &exception)
Print nested exception(s) in exception to os.
Definition exceptions.cpp:212
void PrintComposedExceptions(std::ostream &os, const std::vector< std::exception_ptr > &exceptions)
Print composed exception messages in exceptions list to os.
Definition exceptions.cpp:197
auto WrapWithNested(E &&exception) noexcept(std::is_nothrow_constructible_v< detail::UnspecifiedNested< typename std::decay_t< E > >, E && >)
Constructs an unspecified exception that derives from both the provided object and std::nested_except...
Definition exceptions.hpp:96
Definition measurable.hpp:25
std::ostream & JoinLines(std::ostream &os, std::string_view lines, std::string_view initial_indent, std::string_view subsequent_indent)
Join each line in lines with.
Definition exceptions.cpp:25
Definition commandReplier.cpp:21
Definition ddsSub.hpp:155
Unspecified exception used by WrapWithNested.
Definition exceptions.hpp:57
UnspecifiedNested(E &&e) noexcept(std::is_nothrow_constructible_v< T, E && >)
Definition exceptions.hpp:60