iceoryx2
C++ Language Bindings
Loading...
Searching...
No Matches
iox2::legacy::er Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  AssertViolationKind
 
struct  ConfigurationParameters
 
struct  ConfigurationParameters< ConfigurationTag >
 
struct  ConfigurationTag
 
class  DefaultErrorHandler
 Defines the default reaction of dynamic error handling. The default reaction is to do nothing apart from logging and termination on panic. As this is common for all error handling of the given custom implementation, this happens in the reporting API before the (polymorphic) custom behavior is invoked. More...
 
struct  EnforceViolationKind
 
struct  ErrorCode
 
struct  ErrorDescriptor
 Contains all required information about the error. Can be extended as needed without breaking the interface. More...
 
class  ErrorHandlerInterface
 Defines the dynamic error handling interface (i.e. changeable at runtime). More...
 
struct  FatalKind
 
struct  IsFatal
 
struct  IsFatal< AssertViolationKind >
 
struct  IsFatal< EnforceViolationKind >
 
struct  IsFatal< FatalKind >
 
struct  ModuleId
 
struct  RuntimeErrorKind
 
class  Violation
 

Typedefs

using Configuration = ConfigurationParameters< ConfigurationTag >
 
using ErrorHandler = iox2::legacy::PolymorphicHandler< ErrorHandlerInterface, DefaultErrorHandler >
 
using DefaultErrorHandlerGuard = iox2::legacy::StaticLifetimeGuard< DefaultErrorHandler >
 

Enumerations

enum class  ViolationErrorCode : iox2::legacy::er::ErrorCode::type { ASSERT_VIOLATION , ENFORCE_VIOLATION }
 

Functions

HoofsErrorType toError (HoofsError code)
 
void panic ()
 
void panic (const bb::detail::SourceLocation &location)
 
template<class Message >
void panic (const bb::detail::SourceLocation &location, Message &&msg)
 
template<class Kind , class Error >
void report (const bb::detail::SourceLocation &location, Kind, const Error &error, const char *stringifiedCondition)
 
template<class Error >
void report (const bb::detail::SourceLocation &location, iox2::legacy::er::FatalKind kind, const Error &error, const char *stringifiedCondition)
 
template<class Error >
void report (const bb::detail::SourceLocation &location, iox2::legacy::er::AssertViolationKind kind, const Error &error, const char *stringifiedCondition)
 
template<class Error >
void report (const bb::detail::SourceLocation &location, iox2::legacy::er::EnforceViolationKind kind, const Error &error, const char *stringifiedCondition)
 
template<class Error , class Message >
void report (const bb::detail::SourceLocation &location, iox2::legacy::er::AssertViolationKind kind, const Error &error, const char *stringifiedCondition, Message &&msg)
 
template<class Error , class Message >
void report (const bb::detail::SourceLocation &location, iox2::legacy::er::EnforceViolationKind kind, const Error &error, const char *stringifiedCondition, Message &&msg)
 
template<typename Message >
void forwardPanic (const bb::detail::SourceLocation &location, Message &&msg)
 Forwards that a panic state was encountered and does not return.
 
template<typename Error , typename Kind >
void forwardFatalError (Error &&error, Kind &&kind, const bb::detail::SourceLocation &location, const char *stringifiedCondition)
 Forwards a fatal error and does not return.
 
template<typename Error , typename Kind >
void forwardNonFatalError (Error &&error, Kind &&kind, const bb::detail::SourceLocation &location, const char *stringifiedCondition)
 Forwards a non-fatal error.
 
template<typename Error , typename Kind , typename Message >
void forwardFatalError (Error &&error, Kind &&kind, const bb::detail::SourceLocation &location, const char *stringifiedCondition, Message &&msg)
 Forwards a fatal error and a message and does not return.
 
template<class Kind >
bool constexpr isFatal (Kind)
 
template<>
bool constexpr isFatal< FatalKind > (FatalKind)
 
template<>
bool constexpr isFatal< AssertViolationKind > (AssertViolationKind)
 
template<>
bool constexpr isFatal< EnforceViolationKind > (EnforceViolationKind)
 
template<typename ErrorLike >
auto toError (ErrorLike &&value)
 
template<class Error >
ErrorCode toCode (const Error &error)
 
template<>
ErrorCode toCode< ErrorCode > (const ErrorCode &error)
 
template<class Error >
ModuleId toModule (const Error &error)
 
template<class Error >
const chartoModuleName (const Error &error)
 
template<class Error >
const chartoErrorName (const Error &error)
 

Variables

ModuleId toModule (HoofsError)
 
constexpr RuntimeErrorKind RUNTIME_ERROR {}
 
constexpr FatalKind FATAL
 
constexpr AssertViolationKind ASSERT_VIOLATION
 
constexpr EnforceViolationKind ENFORCE_VIOLATION
 
static constexpr const charUNKNOWN_ERROR_NAME = "unknown error"
 
static constexpr const charUNKNOWN_MODULE_NAME = "unknown module"
 

Typedef Documentation

◆ Configuration

◆ DefaultErrorHandlerGuard

◆ ErrorHandler

Enumeration Type Documentation

◆ ViolationErrorCode

Enumerator
ASSERT_VIOLATION 
ENFORCE_VIOLATION 

Definition at line 34 of file violation.hpp.

Function Documentation

◆ forwardFatalError() [1/2]

template<typename Error , typename Kind >
void iox2::legacy::er::forwardFatalError ( Error &&  error,
Kind &&  kind,
const bb::detail::SourceLocation location,
const char stringifiedCondition 
)
inline

Forwards a fatal error and does not return.

Parameters
errorthe error
kindthe kind of error (category)
locationthe location of the error
stringifiedConditionthe condition as string if a macro with a condition was used; an empty string otherwise

Definition at line 59 of file error_forwarding.hpp.

References iox2::legacy::always_false_v, panic(), and report().

◆ forwardFatalError() [2/2]

void iox2::legacy::er::forwardFatalError ( Error &&  error,
Kind &&  kind,
const bb::detail::SourceLocation location,
const char stringifiedCondition,
Message &&  msg 
)
inline

Forwards a fatal error and a message and does not return.

Parameters
errorthe error
kindthe kind of error (category)
locationthe location of the error
stringifiedConditionthe condition as string if a macro with a condition was used; an empty string otherwise
msgthe message to be forwarded

Definition at line 95 of file error_forwarding.hpp.

References iox2::legacy::always_false_v, panic(), and report().

◆ forwardNonFatalError()

template<typename Error , typename Kind >
void iox2::legacy::er::forwardNonFatalError ( Error &&  error,
Kind &&  kind,
const bb::detail::SourceLocation location,
const char stringifiedCondition 
)
inline

Forwards a non-fatal error.

Parameters
errorthe error
kindthe kind of error (category)
locationthe location of the error
stringifiedConditionthe condition as string if a macro with a condition was used; an empty string otherwise

Definition at line 77 of file error_forwarding.hpp.

References iox2::legacy::always_false_v, and report().

◆ forwardPanic()

template<typename Message >
void iox2::legacy::er::forwardPanic ( const bb::detail::SourceLocation location,
Message &&  msg 
)
inline

Forwards that a panic state was encountered and does not return.

Parameters
locationthe location of the panic invocation
msgthe message to be forwarded
Note
required to enforce no return

Definition at line 37 of file error_forwarding.hpp.

References iox2::legacy::always_false_v, and panic().

Referenced by iox2::legacy::er::detail::unreachable_wrapped().

◆ isFatal()

template<class Kind >
bool constexpr iox2::legacy::er::isFatal ( Kind  )
constexpr

Definition at line 64 of file error_kind.hpp.

◆ isFatal< AssertViolationKind >()

Definition at line 74 of file error_kind.hpp.

◆ isFatal< EnforceViolationKind >()

Definition at line 79 of file error_kind.hpp.

◆ isFatal< FatalKind >()

Definition at line 69 of file error_kind.hpp.

◆ panic() [1/3]

◆ panic() [2/3]

void iox2::legacy::er::panic ( const bb::detail::SourceLocation location)
inline

Definition at line 50 of file error_reporting_impl.hpp.

References IOX2_ERROR_INTERNAL_LOG_PANIC, and panic().

◆ panic() [3/3]

template<class Message >
void iox2::legacy::er::panic ( const bb::detail::SourceLocation location,
Message &&  msg 
)
inline

◆ report() [1/6]

template<class Error >
void iox2::legacy::er::report ( const bb::detail::SourceLocation location,
iox2::legacy::er::AssertViolationKind  kind,
const Error error,
const char stringifiedCondition 
)
inline

◆ report() [2/6]

template<class Error , class Message >
void iox2::legacy::er::report ( const bb::detail::SourceLocation location,
iox2::legacy::er::AssertViolationKind  kind,
const Error error,
const char stringifiedCondition,
Message &&  msg 
)
inline

◆ report() [3/6]

template<class Error >
void iox2::legacy::er::report ( const bb::detail::SourceLocation location,
iox2::legacy::er::EnforceViolationKind  kind,
const Error error,
const char stringifiedCondition 
)
inline

◆ report() [4/6]

template<class Error , class Message >
void iox2::legacy::er::report ( const bb::detail::SourceLocation location,
iox2::legacy::er::EnforceViolationKind  kind,
const Error error,
const char stringifiedCondition,
Message &&  msg 
)
inline

◆ report() [5/6]

◆ report() [6/6]

◆ toCode()

template<class Error >
ErrorCode iox2::legacy::er::toCode ( const Error error)
inline

◆ toCode< ErrorCode >()

template<>
ErrorCode iox2::legacy::er::toCode< ErrorCode > ( const ErrorCode error)
inline

Definition at line 88 of file types.hpp.

◆ toError() [1/2]

template<typename ErrorLike >
auto iox2::legacy::er::toError ( ErrorLike &&  value)

Definition at line 78 of file types.hpp.

◆ toError() [2/2]

HoofsErrorType iox2::legacy::er::toError ( HoofsError  code)
inlineprotected

Definition at line 97 of file hoofs_error_reporting.hpp.

Referenced by toErrorName(), and toModuleName().

◆ toErrorName()

template<class Error >
const char * iox2::legacy::er::toErrorName ( const Error error)
inline

Definition at line 103 of file types.hpp.

References iox2::legacy::HoofsErrorType::name(), and toError().

Referenced by report(), and report().

◆ toModule()

template<class Error >
ModuleId iox2::legacy::er::toModule ( const Error error)
inline

Definition at line 93 of file types.hpp.

◆ toModuleName()

template<class Error >
const char * iox2::legacy::er::toModuleName ( const Error error)
inline

Definition at line 98 of file types.hpp.

References iox2::legacy::HoofsErrorType::moduleName(), and toError().

Referenced by report(), and report().

Variable Documentation

◆ ASSERT_VIOLATION

constexpr AssertViolationKind iox2::legacy::er::ASSERT_VIOLATION
constexpr

Definition at line 87 of file error_kind.hpp.

◆ ENFORCE_VIOLATION

constexpr EnforceViolationKind iox2::legacy::er::ENFORCE_VIOLATION
constexpr

Definition at line 90 of file error_kind.hpp.

◆ FATAL

constexpr FatalKind iox2::legacy::er::FATAL
constexpr

Definition at line 84 of file error_kind.hpp.

◆ RUNTIME_ERROR

constexpr RuntimeErrorKind iox2::legacy::er::RUNTIME_ERROR {}
constexpr

Definition at line 33 of file error_kind.hpp.

◆ toModule

ModuleId iox2::legacy::er::toModule(HoofsError) ( HoofsError  )
inlineprotected

Definition at line 101 of file hoofs_error_reporting.hpp.

◆ UNKNOWN_ERROR_NAME

constexpr const char* iox2::legacy::er::UNKNOWN_ERROR_NAME = "unknown error"
staticconstexpr

Definition at line 24 of file types.hpp.

◆ UNKNOWN_MODULE_NAME

constexpr const char* iox2::legacy::er::UNKNOWN_MODULE_NAME = "unknown module"
staticconstexpr

Definition at line 25 of file types.hpp.