ADTF  3.18.2
ResultDescriptionTraits< DescriptionIntf >final

Traits type for the result description. More...

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)
 Check whether the detailed description was allocated. More...
 
static bool isErrorCodeSet (std::uint64_t value)
 Check whether only the error code was set. More...
 
constexpr static std::uint64_t toInternalErrorCode (std::int32_t error_code) noexcept
 Get the internal error code representation from the external error code. More...
 
constexpr static std::int32_t toExternalErrorCode (std::uint64_t error_code) noexcept
 Get the external error code from the internal error code representation. More...
 
constexpr static const ReferenceCountedDescriptionTypetoInternalErrorPointer (std::uint64_t error_code) noexcept
 Get the internal error pointer representation from the internal error code representation. More...
 

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.
 

Private Member Functions

 ~ResultDescriptionTraits ()
 To implement various static checks.
 

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

Definition at line 32 of file result_description_decl.h.

Member Function Documentation

◆ isDetailedDescriptionSet()

bool 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

Definition at line 32 of file result_description_impl.h.

◆ isErrorCodeSet()

bool 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

Definition at line 41 of file result_description_impl.h.

◆ toExternalErrorCode()

constexpr std::int32_t 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

Definition at line 60 of file result_description_impl.h.

◆ toInternalErrorCode()

constexpr std::uint64_t 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

Definition at line 48 of file result_description_impl.h.

◆ toInternalErrorPointer()

constexpr const ReferenceCountedObjectInterface< 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

Definition at line 72 of file result_description_impl.h.