Wrapper for either a pointer to a detailed description object or simply a numeric error code.
More...
template<typename DescriptionIntf>
class a_util::result::detail::ResultDescription< DescriptionIntf >
Wrapper for either a pointer to a detailed description object or simply a numeric error code.
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)
- Template Parameters
-
| DescriptionIntf | The interface used to retrieve the error information |
template<typename DescriptionIntf>
template<typename DescriptionImpl, typename... Args>
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.
- Template Parameters
-
| DescriptionImpl | The concrete implementation type to contain the detailed error description. The first constructor argument must be of type std::int32_t. |
| Args | Constructor arguments for the allocation of type Implementation |
- Parameters
-
| [in] | error_code | 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. |
- Returns
- Object of type
ResultDescription containing heap allocated error information.