8 #ifndef _A_UTILS_CORE_RESULT_DESCRIPTION_H_
9 #define _A_UTILS_CORE_RESULT_DESCRIPTION_H_
24 template<
typename DescriptionType>
78 template<
typename DescriptionType>
93 result_description& operator=(
const result_description& oOther)
95 using reference_counted_impl_type =
96 typename traits_type::reference_counted_object_type;
102 reinterpret_cast<reference_counted_impl_type*
>(m_pDetailedResult)->RemoveReference();
104 m_pDetailedResult = oOther.m_pDetailedResult;
107 reinterpret_cast<reference_counted_impl_type*
>(m_pDetailedResult)->AddReference();
113 ~result_description()
117 using reference_counted_impl_type=
typename traits_type::reference_counted_object_type;
118 reinterpret_cast<reference_counted_impl_type*
>(m_pDetailedResult)->RemoveReference();
142 template<
typename Implementation,
typename... Args>
186 (m_pDetailedResult | 0xFFFFFFFF00000000)
197 std::uint64_t m_pDetailedResult;
201 m_pDetailedResult(((nErrorCode & 0xFFFFFFFF) |
traits_type::error_code_bit))
219 static_assert(
sizeof(std::uintptr_t) <= 8,
220 "result_description pointers must always have a size of 8 Byte or less!");
222 "Description type unsupported size!");
224 "Description type is not of standard layout!");
226 return i_oLHS.get_error_code() == i_oRHS.get_error_code()
227 && i_oLHS.get_detailed_description() == i_oRHS.get_detailed_description();
241 return !(i_oLHS == i_oRHS);
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
An internal stable interface for binary compatibility of reference counting.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
tBool operator==(const cMultiArrayIndex &o_A, const cMultiArrayIndex &o_B)
Comparison operator.
tBool operator!=(const cMultiArrayIndex &o_A, const cMultiArrayIndex &o_B)
Comparison operator.
Traits type for the result description.
static constexpr std::uint64_t error_code_bit
The error code bit indicating whether only the error code (1) was set or not (0)
static tBool is_detailed_description_set(const std::uint64_t i_pDescription) noexcept
Check whether the detailed description was allocated.
DescriptionType description_type
The description type.
static tBool is_error_code_set(const std::uint64_t i_pDescription) noexcept
Check whether only the error code was set.
static constexpr std::uint64_t error_code_bitmask
The error code bitmask to mask out the error code bit.
64 Bit error type has max 63 Bit large pointer type member variable
tErrorCode get_error_code() const noexcept
Get the error code if only the error code was set.
DescriptionType desc_type
Description type.
static self_type make_result_description(const tErrorCode &i_oErrorCode) noexcept
Make the result description object only with an error code.
static self_type make_result_description(const tErrorCode &i_oErrorCode, Args &&... args) noexcept
Allocate an object being able to store detailed error information.
result_description< DescriptionType > self_type
Self type.
result_description_traits< DescriptionType > traits_type
Traits type abbreviation.
desc_type const * get_detailed_description() const noexcept
Get the detailed description if any was allocated.
C++11 POD type to distribute error codes between binary boundaries.
tInt32 error_code_type
Type of the error code.