casa
5.7.0-16
|
#include <Try.h>
Public Types | |
typedef A | value_type |
Public Member Functions | |
Try () | |
Constructors. More... | |
Try (const A &a) | |
Try (A &&a) | |
Try (const std::exception_ptr &e) | |
Try (std::exception_ptr &&e) | |
Try (const Try< A > &ta) | |
Try (Try< A > &&ta) | |
Try< A > & | operator= (const Try< A > &ta) |
Instance methods. More... | |
Try< A > & | operator= (Try< A > &&ta) |
bool | operator== (const Try< A > &ta) const |
bool | operator!= (const Try< A > &ta) const |
template<typename F , typename TB = typename std::result_of<F()>::type, class = std::enable_if<std::is_base_of<TryBase,TB>::value>> | |
TB | andThen (F &&f) const |
template<typename F , class = std::enable_if< std::is_convertible<std::result_of<F(const A&)>,bool>::value>> | |
Try< A > | filter (F &&f) const |
template<typename F , typename TB = typename std::result_of<F(const A&)>::type, class = std::enable_if<std::is_base_of<TryBase,TB>::value>> | |
TB | flatMap (F &&f) const |
template<class = std::enable_if<std::is_base_of<TryBase,A>::value>> | |
A | flatten () const |
template<typename Err , typename Val , typename B = typename std::result_of<Err(const std::exception_ptr&)>::type, typename C = typename std::result_of<Val(const A&)>::type, class = std::enable_if<std::is_same<B,C>::value>> | |
B | fold (Err &&err, Val &&val) const |
template<typename F > | |
void | foreach (F &&f) const |
A | get () const |
template<typename F , typename B = typename std::result_of<F()>::type, class = typename std::enable_if<std::is_base_of<B, A>::value>> | |
B | getOrElse (F &&f) const |
template<typename B , class = typename std::enable_if<std::is_base_of<B, A>::value>> | |
B | getOrElse_ (const B &b) const |
bool | isSuccess () const |
template<typename F , typename B = typename std::result_of<F(const A&)>::type> | |
Try< B > | map (F &&f) const |
template<typename F , typename TB = typename std::result_of<F()>::type, class = std::enable_if<std::is_base_of<TryBase,TB>::value>, class = std::enable_if< std::is_base_of<typename TB::value_type,A>::value>> | |
TB | orElse (F &&f) const |
template<typename TB , class = std::enable_if<std::is_base_of<TryBase,TB>::value>, class = std::enable_if< std::is_base_of<typename TB::value_type,A>::value>> | |
TB | orElse_ (const TB &tb) const |
template<typename F , class = std::enable_if< std::is_convertible< std::result_of<F(const std::exception&)>,A>::value>> | |
Try< A > | recoverWith (F &&f) const |
template<typename Err , typename Val , typename TB = typename std::result_of<Err(const std::exception_ptr&)>::type, typename TC = typename std::result_of<Val(const A&)>::type, class = std::enable_if<std::is_base_of<TryBase,TB>::value>, class = std::enable_if<std::is_base_of<TryBase,TC>::value>, class = std::enable_if<std::is_same<TB,TC>::value >> | |
TB | transform (Err &&err, Val &&val) const |
template<typename F , typename B = typename std::result_of<F(const A&)>::type> | |
Try< B > | operator| (F &&f) const |
template<typename F , typename TB = typename std::result_of<F(const A&)>::type, class = std::enable_if<std::is_base_of<TryBase,TB>::value>> | |
TB | operator>>= (F &&f) const |
template<typename F , typename TB = typename std::result_of<F()>::type, class = std::enable_if<std::is_base_of<TryBase,TB>::value>> | |
TB | operator>> (F &&f) const |
Static Public Member Functions | |
template<typename F , class = std::enable_if< std::is_convertible<std::result_of<F()>,A>::value,A>> | |
static Try< A > | from (F &&f) |
Static methods. More... | |
template<typename F , typename B = typename std::result_of<F(const A&)>::type> | |
static std::function< Try< B > const Try< A > &)> | lift (F f) |
Private Attributes | |
bool | m_isSuccess |
std::unique_ptr< A > | m_value |
std::exception_ptr | m_exception |
typedef A casa::vi::Try< A >::value_type |
|
inline |
|
inline |
Definition at line 65 of file Try.h.
References casa::vi::Try< A >::m_value.
|
inline |
Definition at line 70 of file Try.h.
References casa::vi::Try< A >::m_value, and move().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 167 of file Try.h.
References casa::vi::Try< A >::flatMap().
Referenced by casa::vi::Try< A >::operator>>().
|
inline |
Definition at line 179 of file Try.h.
References casa::vi::Try< A >::m_isSuccess, and casa::vi::Try< A >::m_value.
|
inline |
Definition at line 200 of file Try.h.
References casa::vi::Try< A >::map().
Referenced by casa::vi::Try< A >::andThen(), and casa::vi::Try< A >::operator>>=().
|
inline |
Definition at line 210 of file Try.h.
References casa::vi::Try< A >::m_exception, casa::vi::Try< A >::m_isSuccess, and casa::vi::Try< A >::m_value.
|
inline |
Definition at line 227 of file Try.h.
References casa::vi::Try< A >::m_exception, casa::vi::Try< A >::m_isSuccess, and casa::vi::Try< A >::m_value.
Referenced by casa::vi::Try< A >::transform().
Definition at line 238 of file Try.h.
References casa::vi::Try< A >::m_isSuccess, and casa::vi::Try< A >::m_value.
|
inlinestatic |
Static methods.
Definition at line 101 of file Try.h.
Referenced by casa::vi::Try< A >::recoverWith(), and casa::vi::try_().
|
inline |
Definition at line 247 of file Try.h.
References casa::vi::Try< A >::m_exception, casa::vi::Try< A >::m_isSuccess, and casa::vi::Try< A >::m_value.
|
inline |
Definition at line 260 of file Try.h.
References casa::vi::Try< A >::m_isSuccess, and casa::vi::Try< A >::m_value.
Referenced by casa::vi::Try< A >::getOrElse_().
|
inline |
Definition at line 272 of file Try.h.
References casa::vi::Try< A >::getOrElse().
|
inline |
Definition at line 277 of file Try.h.
References casa::vi::Try< A >::m_isSuccess.
|
inlinestatic |
|
inline |
Definition at line 288 of file Try.h.
References casa::vi::Try< A >::m_exception, casa::vi::Try< A >::m_isSuccess, and casa::vi::Try< A >::m_value.
Referenced by casa::vi::Try< A >::flatMap(), and casa::vi::Try< A >::operator|().
|
inline |
|
inline |
Instance methods.
Definition at line 130 of file Try.h.
References casa::vi::Try< A >::m_exception, casa::vi::Try< A >::m_isSuccess, and casa::vi::Try< A >::m_value.
|
inline |
Definition at line 139 of file Try.h.
References casa::vi::Try< A >::m_exception, casa::vi::Try< A >::m_isSuccess, casa::vi::Try< A >::m_value, and move().
|
inline |
Definition at line 148 of file Try.h.
References casa::vi::Try< A >::m_exception, casa::vi::Try< A >::m_isSuccess, and casa::vi::Try< A >::m_value.
|
inline |
Definition at line 400 of file Try.h.
References casa::vi::Try< A >::andThen().
|
inline |
Definition at line 388 of file Try.h.
References casa::vi::Try< A >::flatMap().
|
inline |
Definition at line 376 of file Try.h.
References casa::vi::Try< A >::map().
|
inline |
Definition at line 310 of file Try.h.
References casa::vi::Try< A >::m_isSuccess.
Referenced by casa::vi::Try< A >::orElse_().
|
inline |
Definition at line 326 of file Try.h.
References casa::vi::Try< A >::orElse().
|
inline |
Definition at line 339 of file Try.h.
References casacore::C::e, casa::vi::Try< A >::from(), casa::vi::Try< A >::m_exception, and casa::vi::Try< A >::m_isSuccess.
|
inline |
Definition at line 362 of file Try.h.
References casa::vi::Try< A >::fold().
|
private |
Definition at line 409 of file Try.h.
Referenced by casa::vi::Try< A >::flatten(), casa::vi::Try< A >::fold(), casa::vi::Try< A >::get(), casa::vi::Try< A >::map(), casa::vi::Try< A >::operator=(), casa::vi::Try< A >::operator==(), and casa::vi::Try< A >::recoverWith().
|
private |
Definition at line 405 of file Try.h.
Referenced by casa::vi::Try< A >::filter(), casa::vi::Try< A >::flatten(), casa::vi::Try< A >::fold(), casa::vi::Try< A >::foreach(), casa::vi::Try< A >::get(), casa::vi::Try< A >::getOrElse(), casa::vi::Try< A >::isSuccess(), casa::vi::Try< A >::map(), casa::vi::Try< A >::operator=(), casa::vi::Try< A >::operator==(), casa::vi::Try< A >::orElse(), and casa::vi::Try< A >::recoverWith().
|
private |
Definition at line 407 of file Try.h.
Referenced by casa::vi::Try< A >::filter(), casa::vi::Try< A >::flatten(), casa::vi::Try< A >::fold(), casa::vi::Try< A >::foreach(), casa::vi::Try< A >::get(), casa::vi::Try< A >::getOrElse(), casa::vi::Try< A >::map(), casa::vi::Try< A >::operator=(), casa::vi::Try< A >::operator==(), and casa::vi::Try< A >::Try().