Carries a value alongside a task report status.
More...
#include <spk_expected.hpp>
|
|
using | ReportStatus = TaskResult<TReportStatusType> |
| | Report status container type.
|
|
|
| Expected ()=default |
| | Builds a default-initialized expected value.
|
| | Expected (const TType &p_value, const TReportStatusType &p_reportStatusID, const std::wstring &p_reportStatusMessage) |
| | Builds an expected value with a report status.
|
| | Expected (TType &&p_value, const TReportStatusType &p_reportStatusID, const std::wstring &p_reportStatusMessage) |
| | Builds an expected value by moving the payload and adding a report status.
|
| TType & | value () |
| | Returns a mutable reference to the stored value.
|
| const TType & | value () const |
| | Returns a const reference to the stored value.
|
| ReportStatus & | reportStatus () |
| | Returns a mutable reference to the report status.
|
| const ReportStatus & | reportStatus () const |
| | Returns a const reference to the report status.
|
|
| static Expected | generateReport (const TReportStatusType &p_reportStatusID, const std::wstring &p_reportStatusMessage) |
| | Creates an expected value with a default-initialized payload and report status.
|
template<typename TType, typename TReportStatusType = size_t>
class spk::Expected< TType, TReportStatusType >
Carries a value alongside a task report status.
- Template Parameters
-
| TType | Value type stored in the expected result. |
| TReportStatusType | Status identifier type for the report. |
- See also
- TaskResult
auto &
value = result.value();
Carries a value alongside a task report status.
Definition spk_expected.hpp:24
TType & value()
Returns a mutable reference to the stored value.
Definition spk_expected.hpp:78
◆ Expected() [1/2]
template<typename TType, typename TReportStatusType = size_t>
| spk::Expected< TType, TReportStatusType >::Expected |
( |
const TType & | p_value, |
|
|
const TReportStatusType & | p_reportStatusID, |
|
|
const std::wstring & | p_reportStatusMessage ) |
|
inlineexplicit |
Builds an expected value with a report status.
- Parameters
-
| p_value | Value to store. |
| p_reportStatusID | Status identifier. |
| p_reportStatusMessage | Status message. |
◆ Expected() [2/2]
template<typename TType, typename TReportStatusType = size_t>
| spk::Expected< TType, TReportStatusType >::Expected |
( |
TType && | p_value, |
|
|
const TReportStatusType & | p_reportStatusID, |
|
|
const std::wstring & | p_reportStatusMessage ) |
|
inlineexplicit |
Builds an expected value by moving the payload and adding a report status.
- Parameters
-
| p_value | Value to move into the expected instance. |
| p_reportStatusID | Status identifier. |
| p_reportStatusMessage | Status message. |
◆ generateReport()
template<typename TType, typename TReportStatusType = size_t>
| Expected spk::Expected< TType, TReportStatusType >::generateReport |
( |
const TReportStatusType & | p_reportStatusID, |
|
|
const std::wstring & | p_reportStatusMessage ) |
|
inlinestatic |
Creates an expected value with a default-initialized payload and report status.
- Parameters
-
| p_reportStatusID | Status identifier. |
| p_reportStatusMessage | Status message. |
- Returns
- Expected value with the report status filled.
◆ reportStatus() [1/2]
template<typename TType, typename TReportStatusType = size_t>
Returns a mutable reference to the report status.
- Returns
- Mutable report status reference.
◆ reportStatus() [2/2]
template<typename TType, typename TReportStatusType = size_t>
Returns a const reference to the report status.
- Returns
- Const report status reference.
◆ value() [1/2]
template<typename TType, typename TReportStatusType = size_t>
Returns a mutable reference to the stored value.
- Returns
- Mutable value reference.
◆ value() [2/2]
template<typename TType, typename TReportStatusType = size_t>
| const TType & spk::Expected< TType, TReportStatusType >::value |
( |
| ) |
const |
|
inline |
Returns a const reference to the stored value.
- Returns
- Const value reference.
The documentation for this class was generated from the following file: