Compute Graph Framework SDK Reference  5.8
dw::framework::Exception Class Reference

Detailed Description

Definition at line 53 of file Exception.hpp.

Inheritance diagram for dw::framework::Exception:
Collaboration diagram for dw::framework::Exception:

Public Member Functions

 Exception (dwStatus statusCode, const char8_t *messageStr)
 
template<class... Tothers>
 Exception (dwStatus statusCode, const char8_t *messageStr, Tothers... others)
 
char8_t const * messageStr () const noexcept
 
dwStatus status () const
 
 ~Exception () noexcept override=default
 

Static Public Member Functions

template<typename TryBlock >
static dwStatus guard (TryBlock tryBlock, dw::core::Logger::Verbosity verbosity=dw::core::Logger::Verbosity::DEBUG)
 
template<typename TryBlock >
static dwStatus guardWithNoPrint (TryBlock tryBlock)
 
template<typename TryBlock >
static dwStatus guardWithReturn (TryBlock tryBlock, dw::core::Logger::Verbosity verbosity=dw::core::Logger::Verbosity::DEBUG)
 

Static Public Attributes

static constexpr char8_t LOG_TAG [] = "Exception"
 

Constructor & Destructor Documentation

◆ Exception() [1/2]

dw::framework::Exception::Exception ( dwStatus  statusCode,
const char8_t *  messageStr 
)
inline

Definition at line 58 of file Exception.hpp.

References messageStr().

◆ ~Exception()

dw::framework::Exception::~Exception ( )
overridedefaultnoexcept

◆ Exception() [2/2]

template<class... Tothers>
dw::framework::Exception::Exception ( dwStatus  statusCode,
const char8_t *  messageStr,
Tothers...  others 
)
inlineexplicit

Definition at line 73 of file Exception.hpp.

Member Function Documentation

◆ guard()

template<typename TryBlock >
dwStatus dw::framework::Exception::guard ( TryBlock  tryBlock,
dw::core::Logger::Verbosity  verbosity = dw::core::Logger::Verbosity::DEBUG 
)
static

Same as previous guard but with a simpler tryBlock with signature 'void tryBlock()' Always returns DW_SUCCESS unless an exception is thrown.

Definition at line 228 of file Exception.hpp.

References guardWithReturn().

Referenced by dw::framework::PortInput< T >::bindChannel(), dw::framework::PortOutput< T >::bindChannelWithReference(), dw::framework::ExceptionSafeProcessNode::resetPorts(), dw::framework::ExceptionSafeSensorNode::resetPorts(), and dw::framework::PassImpl< PassFunctionT >::run().

◆ guardWithNoPrint()

template<typename TryBlock >
dwStatus dw::framework::Exception::guardWithNoPrint ( TryBlock  tryBlock)
static

Definition at line 242 of file Exception.hpp.

References status().

◆ guardWithReturn()

template<typename TryBlock >
dwStatus dw::framework::Exception::guardWithReturn ( TryBlock  tryBlock,
dw::core::Logger::Verbosity  verbosity = dw::core::Logger::Verbosity::DEBUG 
)
static

Simple try/catch handler to catch dw::core::Exception and return a dwStatus error code if the given function block throws. Signature of tryBlock should be "dwStatus tryBlock()".

All errors should be reported through exceptions. If an exception is thrown it will be caught by the guard, a log message with the given severity and the exception message print and it's status code will be returned.

A template is used to allow inlining of the tryBlock.

Definition at line 122 of file Exception.hpp.

References status().

Referenced by dw::framework::dwTraceCollectorNode::executeAsyncReset(), dw::framework::dwGlobalEgomotionNode::executeAsyncReset(), dw::framework::dwRelativeEgomotionIMUNode::executeAsyncReset(), dw::framework::ExceptionSafeProcessNode::getErrorSignal(), dw::framework::ExceptionSafeSensorNode::getErrorSignal(), dw::framework::ExceptionSafeProcessNode::getHealthSignal(), dw::framework::ExceptionSafeSensorNode::getHealthSignal(), dw::framework::ExceptionSafeProcessNode::getName(), dw::framework::ExceptionSafeSensorNode::getName(), dw::framework::ExceptionSafeProcessNode::getPasses(), dw::framework::ExceptionSafeSensorNode::getPasses(), guard(), dw::framework::ExceptionSafeSensorNode::isVirtual(), dw::framework::ExceptionSafeProcessNode::reportCurrentErrorSignal(), dw::framework::ExceptionSafeSensorNode::reportCurrentErrorSignal(), dw::framework::ExceptionSafeProcessNode::reportCurrentHealthSignal(), dw::framework::ExceptionSafeSensorNode::reportCurrentHealthSignal(), dw::framework::ExceptionSafeProcessNode::reset(), dw::framework::ExceptionSafeSensorNode::reset(), dw::framework::ExceptionSafeProcessNode::run(), dw::framework::ExceptionSafeSensorNode::run(), dw::framework::ExceptionSafeProcessNode::runPass(), dw::framework::ExceptionSafeSensorNode::runPass(), dw::framework::ExceptionSafeProcessNode::runPassByID(), dw::framework::ExceptionSafeSensorNode::runPassByID(), dw::framework::ExceptionSafeSensorNode::setAffinityMask(), dw::framework::dwTraceCollectorNode::setAsyncReset(), dw::framework::dwGlobalEgomotionNode::setAsyncReset(), dw::framework::dwRelativeEgomotionIMUNode::setAsyncReset(), dw::framework::ExceptionSafeSensorNode::setDataEventReadCallback(), dw::framework::ExceptionSafeSensorNode::setDataEventWriteCallback(), dw::framework::ExceptionSafeSensorNode::setEndTime(), dw::framework::ExceptionSafeProcessNode::setInputChannel(), dw::framework::ExceptionSafeSensorNode::setInputChannel(), dw::framework::ExceptionSafeProcessNode::setIterationCount(), dw::framework::ExceptionSafeSensorNode::setIterationCount(), dw::framework::ExceptionSafeProcessNode::setName(), dw::framework::ExceptionSafeSensorNode::setName(), dw::framework::ExceptionSafeProcessNode::setOutputChannel(), dw::framework::ExceptionSafeSensorNode::setOutputChannel(), dw::framework::ExceptionSafeSensorNode::setStartTime(), dw::framework::ExceptionSafeProcessNode::setState(), dw::framework::ExceptionSafeSensorNode::setState(), dw::framework::ExceptionSafeSensorNode::setThreadPriority(), dw::framework::ExceptionSafeSensorNode::start(), dw::framework::ExceptionSafeSensorNode::stop(), dw::framework::ExceptionSafeProcessNode::validate(), and dw::framework::ExceptionSafeSensorNode::validate().

◆ messageStr()

char8_t const * dw::framework::Exception::messageStr ( ) const
inlinenoexcept

◆ status()

dwStatus dw::framework::Exception::status ( ) const
inline

Member Data Documentation

◆ LOG_TAG

constexpr char8_t dw::framework::Exception::LOG_TAG[] = "Exception"
staticconstexpr

Definition at line 56 of file Exception.hpp.


The documentation for this class was generated from the following file: