13#ifndef RTCTK_COMPONENTFRAMEWORK_EXCEPTIONS_HPP
14#define RTCTK_COMPONENTFRAMEWORK_EXCEPTIONS_HPP
18#include <ciiBasicDataType.hpp>
19#include <ciiException.hpp>
29#ifdef CII_MAKE_EXCEPTION
30#undef CII_MAKE_EXCEPTION
32#define CII_MAKE_EXCEPTION(exceptionType_t, ...) \
33 ::error::elt::details::CreateExceptionObject<exceptionType_t>( \
34 0, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
38#ifdef CII_MAKE_EXCEPTION_WITH_NESTED
39#undef CII_MAKE_EXCEPTION_WITH_NESTED
41#define CII_MAKE_EXCEPTION_WITH_NESTED(exceptionType_t, nested_exception, ...) \
42 ::error::elt::details::CreateExceptionObject<exceptionType_t>( \
43 nested_exception, __FILE__, __LINE__, __FUNCTION__, __VA_ARGS__)
60 requires std::constructible_from<T, E>
62 : T(
std::forward<E>(e)) {
72 std::string_view lines,
73 std::string_view initial_indent,
74 std::string_view subsequent_indent);
98 std::is_nothrow_constructible_v<detail::UnspecifiedNested<typename std::decay_t<E>>, E&&>) {
99 using Type =
typename std::decay_t<E>;
100 static_assert(std::is_class_v<Type>,
"exception must be a non-union class-type");
167 : m_ptr(), m_exception(&exception) {};
172 : m_ptr(std::move(ptr)), m_exception(
nullptr) {};
180 std::stringstream ss;
195 }
else if (printer.m_exception) {
204 std::exception_ptr m_ptr;
205 const std::exception* m_exception;
273 explicit BufferTooSmall(
const std::size_t actual,
const std::size_t expected);
282 const std::size_t expected,
283 const std::string& reason);
InvalidArgumentException(const std::string &message)
Definition exceptions.cpp:180
AdapterCreationException(const std::string &interface_name)
Definition exceptions.cpp:192
std::size_t m_actual
Definition exceptions.hpp:293
std::size_t GetActualBufferSize() const
Definition exceptions.hpp:285
std::size_t m_expected
Definition exceptions.hpp:294
BufferTooSmall(const std::size_t actual, const std::size_t expected)
Construct exception object.
Definition exceptions.cpp:159
std::size_t GetExpectedBufferSize() const
Definition exceptions.hpp:288
RtctkException() noexcept
Definition exceptions.cpp:113
DdtError(const std::string &message)
Definition exceptions.hpp:372
RtctkException() noexcept
Definition exceptions.cpp:113
DdtSinkNotFound(const std::string &message)
Definition exceptions.hpp:357
InitialisationException(const std::string &message)
Definition exceptions.cpp:186
InvalidArgumentException(const std::string &message)
Definition exceptions.cpp:180
InvalidSetting(const std::string &message)
Definition exceptions.hpp:343
RtctkException() noexcept
Definition exceptions.cpp:113
InvalidStateChange(const std::string &message)
Definition exceptions.hpp:329
RtctkException() noexcept
Definition exceptions.cpp:113
RtctkException() noexcept
Definition exceptions.cpp:113
IpcqError(const std::string &message)
Definition exceptions.hpp:387
std::string Str() const
Convenience function for constructing a std::string from the exception.
Definition exceptions.hpp:179
NestedExceptionPrinter(const std::exception &exception) noexcept
Construct from exception derived from std::exception.
Definition exceptions.hpp:166
NestedExceptionPrinter(std::exception_ptr ptr) noexcept
Construct from exception_ptr.
Definition exceptions.hpp:171
friend std::ostream & operator<<(std::ostream &os, const NestedExceptionPrinter &printer)
Formats exception from printer using PrintNestedExceptions.
Definition exceptions.hpp:192
NotImplementedException(const std::string &feature)
Definition exceptions.cpp:124
RtctkException() noexcept
Definition exceptions.cpp:113
~RtctkException() override=default
RtctkException(const RtctkException &other) noexcept
UnsupportedTypeException(const std::string &type)
Definition exceptions.cpp:131
UnsupportedUriException(const elt::mal::Uri &uri)
Definition exceptions.cpp:148
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:33
Definition measurable.hpp:26
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:26
Definition commandReplier.cpp:22
void PrintNestedExceptions(std::ostream &os, const std::exception &exception)
Print nested exception(s) in exception messages to os.
Definition exceptions.cpp:213
void PrintComposedExceptions(std::ostream &os, const std::vector< std::exception_ptr > &exceptions)
Print composed exception(s) in exception messages to os.
Definition exceptions.cpp:198
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:97
Definition ddsSub.hpp:156
Unspecified exception used by WrapWithNested.
Definition exceptions.hpp:58
UnspecifiedNested(E &&e) noexcept(std::is_nothrow_constructible_v< T, E && >)
Definition exceptions.hpp:61