ADTF
|
64 Bit error type has max 63 Bit large pointer type member variable More...
Public Types | |
using | self_type = result_description< DescriptionType > |
Self type. | |
using | desc_type = DescriptionType |
Description type. | |
using | traits_type = result_description_traits< DescriptionType > |
Traits type abbreviation. | |
Public Member Functions | |
result_description (const result_description &oOther) | |
result_description & | operator= (const result_description &oOther) |
desc_type const * | get_detailed_description () const noexcept |
Get the detailed description if any was allocated. More... | |
tErrorCode | get_error_code () const noexcept |
Get the error code if only the error code was set. More... | |
Static Public Member Functions | |
template<typename Implementation , typename... Args> | |
static self_type | make_result_description (const tErrorCode &i_oErrorCode, Args &&... args) noexcept |
Allocate an object being able to store detailed error information. More... | |
static self_type | make_result_description (const tErrorCode &i_oErrorCode) noexcept |
Make the result description object only with an error code. More... | |
Private Member Functions | |
result_description (std::uint64_t nErrorCode) | |
Private Attributes | |
std::uint64_t | m_pDetailedResult |
64 Bit error type has max 63 Bit large pointer type member variable
[1|...|______________________up_to_63_____________________________] [a| b | c ] Regions:
a:
Error code Bit - Indicates whether only the error code in region b was set (1 == yes, 0 == no) b:
padding data with unused pointer bits c:
up to 63 Bits - Either only the error code value or the pointer to the allocated error description (might be nil)DescriptionType | The detailed description type which might be used to allocate space for detailed error information. |
Definition at line 79 of file result_description.h.
|
inlinenoexcept |
Get the detailed description if any was allocated.
nullptr
if none was allocated Definition at line 163 of file result_description.h.
References result_description_traits< DescriptionType >::is_detailed_description_set().
|
inlinenoexcept |
Get the error code if only the error code was set.
Definition at line 179 of file result_description.h.
References result_description_traits< DescriptionType >::error_code_bitmask, and result_description_traits< DescriptionType >::is_error_code_set().
|
inlinestaticnoexcept |
Make the result description object only with an error code.
[in] | i_oErrorCode | The error code to set |
result_description
Definition at line 150 of file result_description.h.
|
staticnoexcept |
Allocate an object being able to store detailed error information.
On common operating systems not the entire 64Bits of a pointer are used to address virtual memory - so there are some spare bits free to be used as user space. However, to safely mask out the appropriate bits, it is checked whether the pointer to the allocated detailed description object indeed does not use the user space bits. If so, the detailed description will not be available and only the error code is set.
Implementation | The concrete implementation type to contain the detailed error description. The first constructor argument must be of type tErrorCode . |
Args | Constructor arguments for the allocation of type Implementation |
[in] | i_oErrorCode | The concrete error code either being used as first constructor argument for type Implementation or if allocation fails as the error code. |
[in] | args | The constructor arguments for the error description object. These usually include information like where did the error occur (line, file, ...) or the error string. |
result_description