zpp
Zephyr C++20 Framework
|
result class More...
#include <result.hpp>
Public Member Functions | |
result () noexcept | |
default initialization to error state More... | |
result (const T_Ok &rhs) noexcept | |
initialization to OK state More... | |
result (T_Ok &&rhs) noexcept | |
initialization to OK state More... | |
result (const error_result< T_Error > &rhs) noexcept | |
initialization to error state More... | |
result (error_result< T_Error > &&rhs) noexcept | |
initialization to error state More... | |
result (const result &rhs) noexcept | |
copy contructor More... | |
result (result &&rhs) noexcept | |
move contructor More... | |
~result () noexcept | |
destructor More... | |
void | assign_value (const T_Ok &v) noexcept |
void | assign_value (T_Ok &&v) noexcept |
void | assign_error (const T_Error &e) noexcept |
void | assign_error (T_Error &&e) noexcept |
result & | operator= (const result &rhs) noexcept |
copy operator More... | |
result & | operator= (result &&rhs) noexcept |
move operator More... | |
result & | operator= (const T_Ok &rhs) noexcept |
copy operator More... | |
result & | operator= (T_Ok &&rhs) noexcept |
move operator More... | |
result & | operator= (const error_result< T_Error > &rhs) noexcept |
copy operator More... | |
result & | operator= (error_result< T_Error > &&rhs) noexcept |
move operator More... | |
T_Ok & | value () noexcept |
return a reference to the OK value More... | |
const T_Ok & | value () const noexcept |
return a const reference to the result value More... | |
T_Error & | error () noexcept |
return a reference to the OK value More... | |
const T_Error & | error () const noexcept |
return a const reference to the result value More... | |
T_Ok & | operator* () noexcept |
return a reference to the result value More... | |
const T_Ok & | operator* () const noexcept |
return a const reference to the result value More... | |
T_Ok * | operator-> () noexcept |
return a pointer to the result value More... | |
const T_Ok * | operator-> () const noexcept |
return a const pointer to the result value More... | |
constexpr bool | has_value () const noexcept |
convert the result to a bool More... | |
constexpr | operator bool () const noexcept |
convert the result to a bool More... | |
result class
T_Ok | the type for the OK result |
T_Error | the type for the error result |
Definition at line 89 of file result.hpp.
|
inlinenoexcept |
default initialization to error state
Definition at line 105 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value.
|
inlinenoexcept |
initialization to OK state
rhs | the OK value to assign |
Definition at line 116 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_ok_value.
|
inlinenoexcept |
initialization to OK state
rhs | the OK value to assign |
Definition at line 127 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_ok_value.
|
inlinenoexcept |
initialization to error state
rhs | the error value to assign |
Definition at line 138 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value.
|
inlinenoexcept |
initialization to error state
rhs | the error value to assign |
Definition at line 150 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value.
|
inlinenoexcept |
copy contructor
rhs | the value to assign |
Definition at line 161 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value, and zpp::result< T_Ok, T_Error >::m_ok_value.
|
inlinenoexcept |
move contructor
rhs | the value to assign |
Definition at line 176 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value, and zpp::result< T_Ok, T_Error >::m_ok_value.
|
inlinenoexcept |
destructor
Definition at line 189 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value, and zpp::result< T_Ok, T_Error >::m_ok_value.
|
inlinenoexcept |
Definition at line 219 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value, and zpp::result< T_Ok, T_Error >::m_ok_value.
Referenced by zpp::thread::join(), zpp::mutex_base< T_Mutex >::lock(), zpp::unique_lock< T_Mutex >::lock(), zpp::thread::name(), zpp::condition_variable_base< T_ConditionVariable >::notify_all(), zpp::condition_variable_base< T_ConditionVariable >::notify_one(), zpp::result< void, T_Error >::operator=(), zpp::result< T_Ok, T_Error >::operator=(), zpp::thread::set_name(), zpp::mutex_base< T_Mutex >::try_lock(), zpp::unique_lock< T_Mutex >::try_lock(), zpp::mutex_base< T_Mutex >::try_lock_for(), zpp::unique_lock< T_Mutex >::try_lock_for(), zpp::condition_variable_base< T_ConditionVariable >::try_wait_for(), zpp::mutex_base< T_Mutex >::unlock(), zpp::unique_lock< T_Mutex >::unlock(), and zpp::condition_variable_base< T_ConditionVariable >::wait().
|
inlinenoexcept |
Definition at line 230 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value, and zpp::result< T_Ok, T_Error >::m_ok_value.
|
inlinenoexcept |
Definition at line 197 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value, and zpp::result< T_Ok, T_Error >::m_ok_value.
Referenced by zpp::thread::abort(), zpp::thread::join(), zpp::mutex_base< T_Mutex >::lock(), zpp::thread::name(), zpp::condition_variable_base< T_ConditionVariable >::notify_all(), zpp::condition_variable_base< T_ConditionVariable >::notify_one(), zpp::result< T_Ok, T_Error >::operator=(), zpp::thread::resume(), zpp::thread::set_name(), zpp::thread::set_priority(), zpp::thread::start(), zpp::thread::suspend(), zpp::mutex_base< T_Mutex >::try_lock(), zpp::mutex_base< T_Mutex >::try_lock_for(), zpp::condition_variable_base< T_ConditionVariable >::try_wait_for(), zpp::mutex_base< T_Mutex >::unlock(), zpp::condition_variable_base< T_ConditionVariable >::wait(), zpp::thread::wakeup(), and ZTEST().
|
inlinenoexcept |
Definition at line 208 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value, and zpp::result< T_Ok, T_Error >::m_ok_value.
|
inlinenoexcept |
return a const reference to the result value
Definition at line 373 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value.
|
inlinenoexcept |
return a reference to the OK value
Definition at line 358 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_error_value.
Referenced by ZTEST().
|
inlineconstexprnoexcept |
convert the result to a bool
Definition at line 438 of file result.hpp.
|
inlineexplicitconstexprnoexcept |
convert the result to a bool
Definition at line 447 of file result.hpp.
|
inlinenoexcept |
return a const reference to the result value
Definition at line 399 of file result.hpp.
References zpp::result< T_Ok, T_Error >::value().
|
inlinenoexcept |
return a reference to the result value
Definition at line 388 of file result.hpp.
References zpp::result< T_Ok, T_Error >::value().
|
inlinenoexcept |
return a const pointer to the result value
Definition at line 425 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_ok_value.
|
inlinenoexcept |
return a pointer to the result value
Definition at line 410 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_ok_value.
|
inlinenoexcept |
copy operator
rhs | the value to assign |
Definition at line 302 of file result.hpp.
References zpp::result< T_Ok, T_Error >::assign_error().
|
inlinenoexcept |
copy operator
rhs | the value to assign |
Definition at line 247 of file result.hpp.
References zpp::result< T_Ok, T_Error >::assign_error(), and zpp::result< T_Ok, T_Error >::assign_value().
|
inlinenoexcept |
copy operator
rhs | the value to assign |
Definition at line 280 of file result.hpp.
References zpp::result< T_Ok, T_Error >::assign_value().
|
inlinenoexcept |
move operator
rhs | the value to assign |
Definition at line 313 of file result.hpp.
References zpp::result< T_Ok, T_Error >::assign_error().
|
inlinenoexcept |
move operator
rhs | the value to assign |
Definition at line 263 of file result.hpp.
References zpp::result< T_Ok, T_Error >::assign_error(), and zpp::result< T_Ok, T_Error >::assign_value().
|
inlinenoexcept |
move operator
rhs | the value to assign |
Definition at line 291 of file result.hpp.
References zpp::result< T_Ok, T_Error >::assign_value().
|
inlinenoexcept |
return a const reference to the result value
Definition at line 342 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_ok_value.
|
inlinenoexcept |
return a reference to the OK value
Definition at line 327 of file result.hpp.
References zpp::result< T_Ok, T_Error >::m_ok_value.
Referenced by zpp::result< T_Ok, T_Error >::operator*(), and ZTEST().
T_Error zpp::result< T_Ok, T_Error >::m_error_value |
Definition at line 453 of file result.hpp.
Referenced by zpp::result< T_Ok, T_Error >::result(), zpp::result< T_Ok, T_Error >::~result(), zpp::result< T_Ok, T_Error >::assign_error(), zpp::result< void, T_Error >::assign_error(), zpp::result< T_Ok, T_Error >::assign_value(), zpp::result< T_Ok, T_Error >::error(), and zpp::result< void, T_Error >::error().
T_Ok zpp::result< T_Ok, T_Error >::m_ok_value |
Definition at line 454 of file result.hpp.
Referenced by zpp::result< T_Ok, T_Error >::result(), zpp::result< T_Ok, T_Error >::~result(), zpp::result< T_Ok, T_Error >::assign_error(), zpp::result< T_Ok, T_Error >::assign_value(), zpp::result< T_Ok, T_Error >::operator->(), and zpp::result< T_Ok, T_Error >::value().