ADTF
Loading...
Searching...
No Matches
a_util::result::detail::ResultDescriptionTraits< DescriptionIntf > Struct Template Referencefinal

#include <result_description_decl.h>

Public Types

typedef ReferenceCountedObjectInterface< DescriptionIntf > ReferenceCountedDescriptionType
 Reference counted error description type.
 

Public Member Functions

 ResultDescriptionTraits ()=delete
 Must not be constructed/copied/moved.
 
 ResultDescriptionTraits (const ResultDescriptionTraits &)=delete
 
ResultDescriptionTraitsoperator= (const ResultDescriptionTraits &)=delete
 
 ResultDescriptionTraits (ResultDescriptionTraits &&)=delete
 
ResultDescriptionTraitsoperator= (ResultDescriptionTraits &&)=delete
 

Static Public Member Functions

static bool isDetailedDescriptionSet (std::uint64_t value)
 
static bool isErrorCodeSet (std::uint64_t value)
 
static constexpr std::uint64_t toInternalErrorCode (std::int32_t error_code) noexcept
 
static constexpr std::int32_t toExternalErrorCode (std::uint64_t error_code) noexcept
 
static constexpr const ReferenceCountedDescriptionTypetoInternalErrorPointer (std::uint64_t error_code) noexcept
 

Static Public Attributes

static const std::uint64_t error_code_bit = 1ull << 63
 The error code bit indicating whether only the error code (1) was set or not (0)
 
static const std::uint64_t error_code_bitmask = ~error_code_bit
 The error code bitmask to mask out the error code bit.
 
static const std::uint64_t error_code_serialize_bitmask = 0x00000000FFFFFFFF
 The bitmask to serialize the error code to its internal representation.
 
static const std::uint64_t error_code_deserialize_bitmask = 0xFFFFFFFF00000000
 The bitmask to deserialize the internal error representation to its original value.
 

Detailed Description

template<typename DescriptionIntf>
struct a_util::result::detail::ResultDescriptionTraits< DescriptionIntf >

Traits type for the result description

Template Parameters
DescriptionIntfThe interface used to retrieve the error information

Member Function Documentation

◆ isDetailedDescriptionSet()

template<typename DescriptionIntf>
bool a_util::result::detail::ResultDescriptionTraits< DescriptionIntf >::isDetailedDescriptionSet ( std::uint64_t value)
inlinestatic

Check whether the detailed description was allocated

Parameters
[in]valueTo check whether a detailed description was allocated
Returns
true if detailed description was allocated (the error code bit is not set), false otherwise

◆ isErrorCodeSet()

template<typename DescriptionIntf>
bool a_util::result::detail::ResultDescriptionTraits< DescriptionIntf >::isErrorCodeSet ( std::uint64_t value)
inlinestatic

Check whether only the error code was set

Parameters
[in]valuePointer to the description type that is checked for the error code bit.
Returns
true if only the error code was set (the error code bit is set), false otherwise

◆ toExternalErrorCode()

template<typename DescriptionIntf>
std::int32_t a_util::result::detail::ResultDescriptionTraits< DescriptionIntf >::toExternalErrorCode ( std::uint64_t error_code)
inlinestaticconstexprnoexcept

Get the external error code from the internal error code representation

Parameters
[in]error_codeThe internal error code representation.
Returns
External error code

◆ toInternalErrorCode()

template<typename DescriptionIntf>
std::uint64_t a_util::result::detail::ResultDescriptionTraits< DescriptionIntf >::toInternalErrorCode ( std::int32_t error_code)
inlinestaticconstexprnoexcept

Get the internal error code representation from the external error code

Parameters
[in]error_codeThe external error code
Returns
Internal error code representation of error_code

◆ toInternalErrorPointer()

template<typename DescriptionIntf>
const ReferenceCountedObjectInterface< DescriptionIntf > * a_util::result::detail::ResultDescriptionTraits< DescriptionIntf >::toInternalErrorPointer ( std::uint64_t error_code)
inlinestaticconstexprnoexcept

Get the internal error pointer representation from the internal error code representation

Parameters
[in]error_codeThe internal error code representation
Returns
Pointer to the internal error description interface

The documentation for this struct was generated from the following files: