ADTF
Loading...
Searching...
No Matches
result.h File Reference

Copyright © Audi Electronics Venture GmbH. More...

Go to the source code of this file.

Classes

class  cResult
 A common result class usable as return value throughout. More...
 
struct  cResult::sErrorEval< ErrorType, ErrorTypes >
 Used as entry point for comparison on the error codes used in IsEqual() More...
 
struct  cResult::sErrorEval< ErrorType >
 Used as exit point for comparison on the error codes used in IsEqual() More...
 

Namespaces

namespace  A_UTILS_NS
 ADTF A_UTIL Namespace - Within adtf this is used as util or adtf_util.
 

Macros

#define IS_OK(s)
 Check if result is OK.
 
#define IS_FAILED(s)
 Check if result is failed.
 
#define RETURN_NOERROR   return ERR_NOERROR
 Return status ERR_NOERROR, which requires the calling function's return type to be tResult.
 
#define RETURN_ERROR(code)
 Return specific error code, which requires the calling function's return type to be tResult.
 
#define RETURN_ERROR_DESC(_code, ...)
 Same as RETURN_ERROR(_error) using a printf like parameter list for detailed error description.
 
#define RETURN_IF_POINTER_NULL(_ptr)
 Return ERR_POINTER if _ptr is nullptr, which requires the calling function's return type to be tResult.
 
#define RETURN_IF_POINTER_NULL_DESC(_ptr, ...)
 Return ERR_POINTER with description if _ptr is nullptr, which requires the calling function's return type to be tResult.
 
#define ADTF_UTIL_ANNOTATE_RESULT(_result)
 for internal use
 
#define ADTF_UTIL_COMPOSED_RESULT(_result, ...)
 for internal use
 
#define THROW_ERROR_DESC(_code, ...)
 throws a tResult exception
 
#define THROW_IF_FAILED(s)
 throws if the expression returns a failed tResult
 
#define THROW_IF_FAILED_DESC(s, ...)
 throws if the expression returns a failed tResult and ammends the error message.
 
#define RETURN_CURRENT_EXCEPTION()
 returns the current exception as a tResult, use it in a catch block.
 
#define RETURN_CURRENT_EXCEPTION_DESC(...)
 returns the current exception as a tResult and ammends the error message.
 
#define RETURN_IF_THROWS(s)
 if the expression throws an exception, returns a tResult containing the exception information.
 
#define RETURN_IF_THROWS_DESC(s, ...)
 if the expression throws an exception, returns a tResult containing the exception information and ammends the error message.
 
#define RETURN_IF_FAILED(s)
 Return if expression is failed, which requires the calling function's return type to be tResult.
 
#define RETURN_IF_FAILED_DESC(s, ...)
 

Typedefs

using tResult = A_UTILS_NS::cResult
 For backwards compatibility and to bring latest version into scope.
 

Functions

static std::string filename (std::string_view strPath)
 
static std::string filename_with_thread_id (std::string_view strPath)
 
static std::string format (const char *strFormat,...)
 
tBool operator!= (const cResult &i_oLHS, const cResult &i_oRHS) noexcept
 Negated comparison operator (shallow comparison)
 
tBool operator== (const cResult &i_oLHS, const cResult &i_oRHS)
 
template<tErrorCode::error_code_type ErrorCode>
tBool operator== (const cResult &oResult, const tError< ErrorCode > &sCode) noexcept
 Comparison operator (equality) for objects of type cResult and tError.
 
template<tErrorCode::error_code_type ErrorCode>
tBool operator!= (const cResult &oResult, const tError< ErrorCode > &sCode) noexcept
 Comparison operator (inequality) for objects of type cResult and tError.
 
template<tErrorCode::error_code_type ErrorCode>
tBool operator== (const tError< ErrorCode > &sCode, const cResult &oResult) noexcept
 Comparison operator (equality) for objects of type cResult and tError.
 
template<tErrorCode::error_code_type ErrorCode>
tBool operator!= (const tError< ErrorCode > &sCode, const cResult &oResult) noexcept
 Comparison operator (inequality) for objects of type cResult and tError.
 
void swap (cResult &i_oLHS, cResult &i_oRHS)
 
std::string to_string (const cResult &i_oResult)
 
void format_nested_exception (const std::exception &error, std::ostream &stream, bool add_line_break=false)
 
cResult annotate_result (const cResult &oOriginal, const char *strFile, int nLine, const char *strFunction, const tChar *strDescription="")
 
std::string nested_exceptions_to_string (const std::exception &error)
 Formats nested std::exceptions into a string, line by line.
 
std::string current_exception_to_string ()
 Trys to format the current exception into a string.
 
cResult current_exception_to_result (const char *file, size_t line, const char *function)
 
cResult current_exception_to_result ()
 Converts the current exception object into a tResult.
 
template<>
void swap< A_UTILS_NS::cResult > (A_UTILS_NS::cResult &i_oLHS, A_UTILS_NS::cResult &i_oRHS) noexcept
 swap specialization for ADL
 

Detailed Description

Copyright © Audi Electronics Venture GmbH.

All rights reserved

Definition in file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

Macro Definition Documentation

◆ ADTF_UTIL_ANNOTATE_RESULT

#define ADTF_UTIL_ANNOTATE_RESULT ( _result)
Value:
A_UTILS_NS::detail::annotate_result(_result, __FILE__, __LINE__, __FUNC__)

for internal use

Definition at line 602 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

◆ ADTF_UTIL_COMPOSED_RESULT

#define ADTF_UTIL_COMPOSED_RESULT ( _result,
... )
Value:
A_UTILS_NS::detail::annotate_result(_result, __FILE__, __LINE__, __FUNC__, \
A_UTILS_NS::detail::format(__VA_ARGS__).c_str())

for internal use

Definition at line 605 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

◆ IS_FAILED

◆ IS_OK

◆ RETURN_CURRENT_EXCEPTION

#define RETURN_CURRENT_EXCEPTION ( )
Value:
return A_UTILS_NS::detail::current_exception_to_result(__FILE__, __LINE__, __FUNC__)

returns the current exception as a tResult, use it in a catch block.

Definition at line 633 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

◆ RETURN_CURRENT_EXCEPTION_DESC

#define RETURN_CURRENT_EXCEPTION_DESC ( ...)
Value:
return ADTF_UTIL_COMPOSED_RESULT(A_UTILS_NS::detail::current_exception_to_result(__FILE__, __LINE__, __FUNC__), \
__VA_ARGS__)

returns the current exception as a tResult and ammends the error message.

Definition at line 636 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

◆ RETURN_ERROR

#define RETURN_ERROR ( code)
Value:
return (code)

Return specific error code, which requires the calling function's return type to be tResult.

Definition at line 100 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

Referenced by string_list_base< cString >::Add(), string_list_base< cString >::Add(), cMemoryPtr::Alloc(), cFileRingBuffer< ADDITIONAL_DATA, ALIGNMENT >::AppendItem(), cMemoryPtr::Attach(), cBitSerializer::CheckForInvalidArguments(), cMemoryPtr::CopyTo(), cStreamItem::CopyTo(), adtf::streaming::ant::create_inner_pipe(), adtf::streaming::ant::create_inner_pipe(), string_list_base< cString >::Delete(), adtf_ddl::access_element::detail::find_complex_index(), adtf_ddl::access_element::find_index(), cSampleWriter::Flush(), hash_value_map< STORAGE, INTERFACE >::cHashedValueGetter::FromRaw(), adtf_ddl::access_element::get_array(), adtf::streaming::lucky::get_stream_type_audio_format(), adtf_ddl::access_element::get_struct_value(), cLastSampleReader::GetLastSample(), cLastSamplesCollector::GetLastSamples(), cLastSamplesCollector::GetLastSamples(), cSampleSetCollector::GetNextSampleSet(), cStreamItem::GetObject(), named_graph_object< trigger_pipe_item< IRunner > >::GetParent(), cStreamItem::GetSample(), cTimeBasedSampleSetCollector::GetSampleSetAt(), cStreamItem::GetStreamType(), hash_value_map< STORAGE, INTERFACE >::GetValue(), adtf::streaming::riddler::has_trigger_parent(), string_list_base< cString >::Insert(), cSampleWriter::ManualTrigger(), cDDL::MoveChild(), cExternalQueueSampleReader::Pop(), cLimitedSampleReaderQueue::Pop(), cExternalQueuesWrapper::Pop(), cSampleReader::ProcessStreamItem(), cSampleReader::Push(), object_ptr_delegate_base< IObject, StorageType >::Reset(), runnable< base::ant::IRunnable::RUN_PUSH, ISampleStream::IPushReadEventSink >::Run(), runnable< nActivationType, base::ant::IRunnable, adtf::services::ant::IKernel::IKernelRunnable >::Run(), adtf_memory< T, TSIZE >::Set(), adtf_memory_buffer< T, Enable >::Set(), adtf_memory_buffer< T, typename std::enable_if< std::is_const< T >::value >::type >::Set(), adtf_string< T >::Set(), hash_value_map< STORAGE, INTERFACE >::cHashedValueGetter::Set(), hash_value_map< STORAGE, INTERFACE >::cHashedValueSetter::Set(), property_value< T >::Set(), adtf_memory_trivial_type< T, Enable >::Set(), adtf_memory_trivial_type< T, typename std::enable_if< std::is_const< T >::value >::type >::Set(), cStringLengthProxy::Set(), adtf::streaming::lucky::set_stream_type_audio_format(), adtf_ddl::access_element::set_struct_value(), cSampleReader::SetStreamError(), cSampleWriter::SetStreamError(), kernel_timeout::Start(), cFileRingBuffer< ADDITIONAL_DATA, ALIGNMENT >::StartAppending(), cFileRingBuffer< ADDITIONAL_DATA, ALIGNMENT >::StartWrappingAround(), and cSampleWriter::Transmit().

◆ RETURN_ERROR_DESC

◆ RETURN_IF_FAILED

#define RETURN_IF_FAILED ( s)
Value:
{ \
try \
{ \
tResult _errcode(s); \
if (_errcode.IsFailed()) \
{ \
return ADTF_UTIL_ANNOTATE_RESULT(_errcode); \
} \
} \
catch (...) \
{ \
RETURN_CURRENT_EXCEPTION(); \
} \
}
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.

Return if expression is failed, which requires the calling function's return type to be tResult.

Definition at line 668 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

Referenced by decoding_sample_reader< ReaderImplementation >::decoding_sample_reader(), adtf::streaming::devil::add_binding_proxy(), adtf::streaming::devil::add_data_in_port(), adtf::streaming::devil::add_data_out_port(), adtf::streaming::devil::add_graph_object(), adtf::streaming::devil::add_sample_stream_in_port(), adtf::streaming::devil::add_sample_stream_out_port(), graph< INTERFACE >::AddNamedGraphObject(), port_router< T, U >::AddTo(), cFileRingBuffer< ADDITIONAL_DATA, ALIGNMENT >::AppendItem(), cMemoryPtr::Assign(), cSampleReader::BeginStreaming(), cSampleWriter::BeginStreaming(), writer_with_request_broker< BaseWriter >::BeginStreaming(), level_machine< Subclass, LevelType, START_LEVEL >::ChangeLevel(), encoding_sample_writer< WriterImplementation >::ChangeType(), requestable_writer< BaseWriter >::ChangeType(), adtf::streaming::ant::create_client(), adtf::streaming::catwo::create_client(), adtf::streaming::catwo::create_client(), adtf::streaming::flash::create_client(), adtf::streaming::ant::create_inner_pipe(), adtf::streaming::ant::create_inner_pipe(), adtf::streaming::ant::create_pin(), adtf::streaming::ant::create_pin(), adtf::streaming::ant::create_server(), adtf::streaming::catwo::create_server(), adtf::streaming::catwo::create_server(), adtf::streaming::flash::create_server(), cGraphObject::CreateInputPinWithCallback(), cFileRingBuffer< ADDITIONAL_DATA, ALIGNMENT >::FillForAlignment(), hash_value_map< STORAGE, INTERFACE >::Get(), adtf_ddl::access_element::get_array(), adtf_ddl::access_element::get_array_value(), adtf::base::ant::get_property(), adtf_ddl::access_element::get_value(), cLastSamplesCollector::GetLastSamples(), cLastSamplesCollector::GetLastSamples(), cSampleSetCollector::GetNextSampleSet(), cTimeBasedSampleSetCollector::GetSampleSetAt(), filter_with_trigger_function< TriggerFunctionImpl >::Init(), stream_meta_type_plain::IsCompatible(), stream_meta_type_string::IsCompatible(), cDynamicSampleReaderQueue::Pop(), cLimitedSampleReaderQueue::Pop(), cFileRingBuffer< ADDITIONAL_DATA, ALIGNMENT >::PopFront(), cSampleReader::ProcessStreamItem(), cExternalQueueSampleReader::Push(), cSampleReader::Push(), cExternalQueuesWrapper::Push(), Converter< T, 1, 0 >::Read(), adtf::streaming::ant::read_from_sample(), cLastSampleReader::ReadNextSample(), cSampleReader::ReadNextSample(), trigger_pipe_source< INTERFACE >::RegisterSubItem(), sample_data< T >::Reset(), sample_data< T >::Reset(), sample_data< T, Enable >::Reset(), adtf_ddl::access_element::reset(), port_router< T, U >::ResetFrom(), property_value< T >::Set(), adtf::base::ant::set_property(), adtf::base::ant::set_property(), adtf::streaming::ant::set_property(), adtf::streaming::ant::set_property(), adtf_ddl::access_element::set_value(), adtf_ddl::access_element::set_value(), decoding_sample_reader< ReaderImplementation >::SetType(), encoding_sample_writer< WriterImplementation >::SetType(), hash_value_map< STORAGE, INTERFACE >::SetValue(), kernel_timeout::Start(), property_value< T >::ToString(), adtf_ddl::serialization::transform(), sample_writer< DATA_TYPE >::Transmit(), and adtf::streaming::ant::write_to_sample().

◆ RETURN_IF_FAILED_DESC

#define RETURN_IF_FAILED_DESC ( s,
... )
Value:
{ \
try \
{ \
tResult _errcode(s); \
if (_errcode.IsFailed()) \
{ \
return ADTF_UTIL_COMPOSED_RESULT(_errcode, __VA_ARGS__); \
} \
} \
catch (...) \
{ \
RETURN_CURRENT_EXCEPTION_DESC(__VA_ARGS__); \
} \
}

Definition at line 684 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

◆ RETURN_IF_POINTER_NULL

#define RETURN_IF_POINTER_NULL ( _ptr)

◆ RETURN_IF_POINTER_NULL_DESC

#define RETURN_IF_POINTER_NULL_DESC ( _ptr,
... )
Value:
if (nullptr == _ptr) \
{ \
return DETAILED_RESULT(ERR_POINTER, __VA_ARGS__); \
}

Return ERR_POINTER with description if _ptr is nullptr, which requires the calling function's return type to be tResult.

Definition at line 115 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

Referenced by writer_with_request_broker< BaseWriter >::BeginStreaming().

◆ RETURN_IF_THROWS

#define RETURN_IF_THROWS ( s)

◆ RETURN_IF_THROWS_DESC

#define RETURN_IF_THROWS_DESC ( s,
... )
Value:
{ \
try \
{ \
(s); \
} \
catch (...) \
{ \
RETURN_CURRENT_EXCEPTION_DESC(__VA_ARGS__); \
} \
}

if the expression throws an exception, returns a tResult containing the exception information and ammends the error message.

Definition at line 655 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

◆ RETURN_NOERROR

#define RETURN_NOERROR   return ERR_NOERROR

Return status ERR_NOERROR, which requires the calling function's return type to be tResult.

Definition at line 87 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

Referenced by decoding_sample_reader< ReaderImplementation >::decoding_sample_reader(), cActiveRunner::~cActiveRunner(), string_list_base< cString >::Add(), string_list_base< cString >::Add(), graph< INTERFACE >::AddNamedGraphObject(), port_router< T, U >::AddTo(), cMemoryPtr::Alloc(), string_list_base< cString >::Append(), string_list_base< cString >::Append(), cFileRingBuffer< ADDITIONAL_DATA, ALIGNMENT >::AppendItem(), cMemoryPtr::Assign(), cMemoryPtr::Attach(), cSampleReader::BeginStreaming(), cSampleWriter::BeginStreaming(), level_machine< Subclass, LevelType, START_LEVEL >::ChangeLevel(), encoding_sample_writer< WriterImplementation >::ChangeType(), requestable_writer< BaseWriter >::ChangeType(), cBitSerializer::CheckForInvalidArguments(), cLastSamplesCollector::CollectFrom(), cLastSamplesCollector::CollectFrom(), port_router< T, U >::ConnectRouting(), streaming_level_machine::Construct(), ConverterBase< T >::CopyBytesFromBuffer(), cMemoryPtr::CopyTo(), adtf::streaming::ant::create_client(), adtf::streaming::catwo::create_client(), adtf::streaming::catwo::create_client(), adtf::streaming::flash::create_client(), adtf::streaming::ant::create_pin(), adtf::streaming::ant::create_pin(), adtf::streaming::ant::create_server(), adtf::streaming::catwo::create_server(), adtf::streaming::catwo::create_server(), adtf::streaming::flash::create_server(), ConverterBase< T >::CutLeadingBits(), streaming_level_machine::Destruct(), cMemoryPtr::Detach(), port_router< T, U >::DisconnectRouting(), cSampleReader::EndStreaming(), cSampleWriter::EndStreaming(), requestable_writer< BaseWriter >::EndStreaming(), writer_with_request_broker< BaseWriter >::EndStreaming(), cFileRingBuffer< ADDITIONAL_DATA, ALIGNMENT >::FillForAlignment(), adtf_ddl::access_element::find_array_end_index(), adtf_ddl::access_element::detail::find_complex_index(), adtf_ddl::access_element::find_index(), cMultiArray< T >::Get(), hash_value_map< STORAGE, INTERFACE >::Get(), adtf_ddl::access_element::get_array(), adtf_ddl::access_element::get_array_value(), adtf::base::ant::get_property(), adtf::streaming::lucky::get_stream_type_audio_format(), adtf_ddl::access_element::get_struct_value(), class_factory< Classes >::GetClasses(), extend_object< BASE_CLASS, EXTEND_INTERFACE, Child >::GetInterface(), extend_object< BASE_CLASS, EXTEND_INTERFACE, Child >::GetInterface(), named_graph_object< trigger_pipe_item< IRunner > >::GetName(), named_graph_object< trigger_pipe_item< IRunner > >::GetParent(), configuration< Interface >::GetProperties(), configuration< Interface >::GetProperties(), cTimeBasedSampleSetCollector::GetSampleSetAt(), cSystem::cAdapterInfo::HandleAdapterInfo(), cPlayerStreams::HandleStream(), filter_with_trigger_function< TriggerFunctionImpl >::Init(), streaming_level_machine::Init(), cMultiArray< T >::InitializeDataStore(), string_list_base< cString >::Insert(), adtf::streaming::spider::is_equal(), stream_meta_type_anonymous::IsCompatible(), stream_meta_type_plain::IsCompatible(), stream_meta_type_string::IsCompatible(), cDDL::MoveChild(), adtf::remote::ant::parse_logging_rpc_buffer(), cLimitedSampleReaderQueue::Pop(), cFileRingBuffer< ADDITIONAL_DATA, ALIGNMENT >::PopFront(), cSampleReader::ProcessStreamItem(), cExternalQueueSampleReader::Push(), cLimitedSampleReaderQueue::Push(), cSampleReader::Push(), cExternalQueuesWrapper::Push(), Converter< T, 1, 0 >::Read(), cBitSerializer::Read(), cLastSampleReader::ReadNextSample(), ConverterBase< T >::ReadSignal(), sample_data< T >::Reset(), sample_data< T >::Reset(), sample_data< T >::Reset(), sample_data< T, Enable >::Reset(), sample_data< T, Enable >::Reset(), object_ptr_delegate_base< IObject, StorageType >::Reset(), port_router< T, U >::ResetFrom(), cMultiArray< T >::Set(), string_list_base< cString >::Set(), adtf_memory_buffer< T, Enable >::Set(), hash_value_map< STORAGE, INTERFACE >::cHashedValueSetter::Set(), property<::adtf::base::ant::property_attached_configuration_type >::Set(), property_value< T >::Set(), adtf_memory< T, TSIZE, void >::Set(), adtf_memory_trivial_type< T, Enable >::Set(), adtf::streaming::lucky::set_stream_type_audio_format(), adtf_ddl::access_element::set_struct_value(), binding_proxy< INTERFACE, INTERFACE_CHECK >::SetBindingType(), cCodecLegacy< CodecType >::SetElementValue(), cCodecLegacy< CodecType >::SetElementValue(), named_graph_object< trigger_pipe_item< IRunner > >::SetName(), named_graph_object< trigger_pipe_item< IRunner > >::SetParent(), cStreamItem::SetSample(), cStreamItem::SetStreamType(), decoding_sample_reader< ReaderImplementation >::SetType(), encoding_sample_writer< WriterImplementation >::SetType(), sample_streamer< ISampleReader, cInPin >::SetType(), adtf_string_forward< std::string >::SetValue(), streaming_level_machine::Shutdown(), kernel_timeout::Start(), cFileRingBuffer< ADDITIONAL_DATA, ALIGNMENT >::StartAppending(), streaming_level_machine::StartStreaming(), cFileRingBuffer< ADDITIONAL_DATA, ALIGNMENT >::StartWrappingAround(), streaming_level_machine::StopStreaming(), property_value< T >::ToString(), adtf_ddl::serialization::transform(), cBitSerializer::Write(), and ConverterBase< T >::WriteSignal().

◆ THROW_ERROR_DESC

◆ THROW_IF_FAILED

#define THROW_IF_FAILED ( s)
Value:
{ \
tResult _errcode(s); \
if (_errcode.IsFailed()) \
{ \
throw ADTF_UTIL_ANNOTATE_RESULT(_errcode); \
} \
}

throws if the expression returns a failed tResult

Definition at line 613 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

Referenced by md_sample_data_factory< T >::md_sample_data_factory(), md_sample_data_factory< T >::md_sample_data_factory(), output_sample_data< T >::output_sample_data(), output_sample_data< T >::output_sample_data(), output_sample_data< T >::output_sample_data(), stream_type_plain< T >::stream_type_plain(), adtf::streaming::lucky::create_adtf_audio_stream_type(), adtf::streaming::lucky::create_adtf_image_stream_type(), cGraphObject::CreateInterfaceClient(), cGraphObject::CreateInterfaceServer(), cGraphObject::CreateInterfaceServer(), stream_meta_type_string::GetEncoding(), decoding_sample_reader< ReaderImplementation >::GetLastDecoder(), decoding_sample_reader< ReaderImplementation >::GetLastDecoder(), decoding_sample_reader< ReaderImplementation >::GetNextDecoder(), decoding_sample_reader< ReaderImplementation >::GetNextDecoder(), encoding_sample_writer< WriterImplementation >::MakeSample(), property< T, Enable >::Notify(), adtf::streaming::flash::operator<<(), adtf::streaming::flash::operator<<(), adtf::streaming::flash::operator<<(), adtf::streaming::flash::operator<<(), stream_meta_type_string::SetEncoding(), cTestListener::SignalAdded(), and cTestWriter::WriteSubStream().

◆ THROW_IF_FAILED_DESC

#define THROW_IF_FAILED_DESC ( s,
... )
Value:
{ \
tResult _errcode(s); \
if (_errcode.IsFailed()) \
{ \
throw ADTF_UTIL_COMPOSED_RESULT(_errcode, __VA_ARGS__); \
} \
}

throws if the expression returns a failed tResult and ammends the error message.

Definition at line 623 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

Referenced by interface_client< Interface >::Get().

Typedef Documentation

◆ tResult

For backwards compatibility and to bring latest version into scope.

Definition at line 821 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

Function Documentation

◆ annotate_result()

cResult annotate_result ( const cResult & oOriginal,
const char * strFile,
int nLine,
const char * strFunction,
const tChar * strDescription = "" )
inline

◆ current_exception_to_result() [1/2]

cResult current_exception_to_result ( )
inline

Converts the current exception object into a tResult.

Works for both tResult and std::exceptions.

Returns
The result containing the exception information.

Definition at line 812 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

◆ current_exception_to_result() [2/2]

cResult current_exception_to_result ( const char * file,
size_t line,
const char * function )
inline

◆ current_exception_to_string()

std::string current_exception_to_string ( )
inline

Trys to format the current exception into a string.

This works for std::exception and tResult exception objects.

Returns
The formatted string.

Definition at line 754 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

◆ filename()

static std::string filename ( std::string_view strPath)
inlinestatic

◆ filename_with_thread_id()

static std::string filename_with_thread_id ( std::string_view strPath)
inlinestatic

◆ format()

static std::string format ( const char * strFormat,
... )
inlinestatic

◆ format_nested_exception()

void format_nested_exception ( const std::exception & error,
std::ostream & stream,
bool add_line_break = false )
inline

◆ nested_exceptions_to_string()

std::string nested_exceptions_to_string ( const std::exception & error)
inline

Formats nested std::exceptions into a string, line by line.

Parameters
[in]errorthe exception
Returns
The formatted string.

Definition at line 742 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

◆ swap< A_UTILS_NS::cResult >()

template<>
void swap< A_UTILS_NS::cResult > ( A_UTILS_NS::cResult & i_oLHS,
A_UTILS_NS::cResult & i_oRHS )
inlinenoexcept

swap specialization for ADL

Parameters
[in,out]i_oLHSLeft hand side result to be swapped
[in,out]i_oRHSRight hand side result to be swapped

Definition at line 831 of file builds/digitalwerk/solutions/adtf_content/adtf_base/adtf_core/src/libraries/a_utils/include/a_utils/core/result.h.

References A_UTILS_NS::swap().