casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
casa::vi::Future< A > Class Template Reference

#include <Future.h>

Public Types

typedef A value_type
 

Public Member Functions

 Future ()
 Constructors. More...
 
 Future (const A &a)
 
 Future (A &&a)
 
 Future (const std::exception_ptr &e)
 
 Future (std::exception_ptr &&e)
 
 Future (const std::shared_future< Try< A > > &f)
 
 Future (std::shared_future< Try< A > > &&f)
 
 Future (std::future< Try< A > > &&f)
 NB: the following method would be erroneous, since calling std::future::share() is not const on std::future. More...
 
template<typename F , typename FB = typename std::result_of<F(const A&)>::type, class = std::enable_if<std::is_base_of<FutureBase,FB>::value>>
FB flatMap (F &&fn) const
 Instance methods. More...
 
template<class = std::enable_if<std::is_base_of<FutureBase,A>::value>>
flatten () const
 
template<typename F , typename FB = typename std::result_of<F()>::type, class = std::enable_if<std::is_base_of<FutureBase,FB>::value>>
FB followedBy (F fn) const
 
template<typename F , typename FB = typename std::result_of<F()>::type, class = std::enable_if<std::is_base_of<FutureBase,FB>::value >>
Future< A > forEffect (F fn) const
 
Try< A > get () const
 
template<typename P , typename F , class = std::enable_if< std::is_convertible<std::result_of<P(const A&)>,bool>::value>, class = std::enable_if< std::is_same<Future<A>,std::result_of<F(const A&)> >::value>>
Future< A > iterateUntil (P p, F &&f) const
 
template<typename P , typename F , class = std::enable_if< std::is_convertible<std::result_of<P(const A&)>,bool>::value>, class = std::enable_if< std::is_same<Future<A>,std::result_of<F(const A&)> >::value>>
Future< A > iterateWhile (P p, F f) const
 
template<typename F , typename B = typename std::result_of<F(const A&)>::type>
Future< B > map (F fn) const
 
template<typename F , class = std::enable_if< std::is_convertible< std::result_of<F(std::exception_ptr &)>,A>::value>>
Future< A > recoverWith (F fn) const
 
void wait () const
 
template<class Rep , class Period >
std::future_status waitFor (const std::chrono::duration< Rep, Period > &rel_time) const
 
template<class Clock , class Duration >
std::future_status waitUntil (const std::chrono::time_point< Clock, Duration > &abs_time) const
 
template<typename F , typename FB = typename std::result_of<F(const A&)>::type, class = std::enable_if<std::is_base_of<FutureBase,FB>::value>>
FB operator>>= (F &&fn) const
 
template<typename F , typename FB = typename std::result_of<F()>::type, class = std::enable_if<std::is_base_of<FutureBase,FB>::value>>
FB operator>> (F &&fn) const
 
template<typename F , typename B = typename std::result_of<F(const A&)>::type>
Future< B > operator| (F &&fn) const
 

Static Public Member Functions

template<typename F , class = std::enable_if< std::is_convertible<std::result_of<F()>,A>::value,A>>
static Future< A > from (F f)
 Static methods. More...
 
template<typename F , typename B = typename std::result_of<F(const A&)>::type>
static std::function< Future
< B >const Future< A > &)> 
lift (F f)
 

Private Attributes

std::shared_future< Try< A > > m_fta
 

Detailed Description

template<typename A>
class casa::vi::Future< A >

Definition at line 42 of file Future.h.

Member Typedef Documentation

template<typename A >
typedef A casa::vi::Future< A >::value_type

Definition at line 45 of file Future.h.

Constructor & Destructor Documentation

template<typename A >
casa::vi::Future< A >::Future ( )
inline

Constructors.

Definition at line 49 of file Future.h.

References casa::vi::Future< A >::m_fta.

template<typename A >
casa::vi::Future< A >::Future ( const A &  a)
inline

Definition at line 55 of file Future.h.

References casa::vi::Future< A >::m_fta.

template<typename A >
casa::vi::Future< A >::Future ( A &&  a)
inline

Definition at line 61 of file Future.h.

References casa::vi::Future< A >::m_fta, and move().

template<typename A >
casa::vi::Future< A >::Future ( const std::exception_ptr &  e)
inline

Definition at line 67 of file Future.h.

References casa::vi::Future< A >::m_fta.

template<typename A >
casa::vi::Future< A >::Future ( std::exception_ptr &&  e)
inline

Definition at line 73 of file Future.h.

References casacore::C::e, casa::vi::Future< A >::m_fta, and move().

template<typename A >
casa::vi::Future< A >::Future ( const std::shared_future< Try< A > > &  f)
inline

Definition at line 79 of file Future.h.

template<typename A >
casa::vi::Future< A >::Future ( std::shared_future< Try< A > > &&  f)
inline

Definition at line 82 of file Future.h.

template<typename A >
casa::vi::Future< A >::Future ( std::future< Try< A > > &&  f)
inline

NB: the following method would be erroneous, since calling std::future::share() is not const on std::future.

Future(const std::future<Try<A> >& f) : m_fta(f.share()) {};

Definition at line 91 of file Future.h.

Member Function Documentation

template<typename A >
template<typename F , typename FB = typename std::result_of<F(const A&)>::type, class = std::enable_if<std::is_base_of<FutureBase,FB>::value>>
FB casa::vi::Future< A >::flatMap ( F &&  fn) const
inline
template<typename A >
template<class = std::enable_if<std::is_base_of<FutureBase,A>::value>>
A casa::vi::Future< A >::flatten ( ) const
inline

Definition at line 147 of file Future.h.

References casacore::C::e, and casa::vi::Future< A >::m_fta.

template<typename A >
template<typename F , typename FB = typename std::result_of<F()>::type, class = std::enable_if<std::is_base_of<FutureBase,FB>::value>>
FB casa::vi::Future< A >::followedBy ( fn) const
inline

Definition at line 168 of file Future.h.

References casa::vi::Future< A >::flatMap().

Referenced by casa::vi::Future< A >::operator>>().

template<typename A >
template<typename F , typename FB = typename std::result_of<F()>::type, class = std::enable_if<std::is_base_of<FutureBase,FB>::value >>
Future<A> casa::vi::Future< A >::forEffect ( fn) const
inline

Definition at line 180 of file Future.h.

References casa::vi::Future< A >::flatMap().

template<typename A >
template<typename F , class = std::enable_if< std::is_convertible<std::result_of<F()>,A>::value,A>>
static Future<A> casa::vi::Future< A >::from ( f)
inlinestatic

Static methods.

Definition at line 104 of file Future.h.

References casa::vi::try_().

Referenced by casa::vi::future().

template<typename A >
Try<A> casa::vi::Future< A >::get ( ) const
inline

Definition at line 192 of file Future.h.

References casa::vi::Future< A >::m_fta.

template<typename A >
template<typename P , typename F , class = std::enable_if< std::is_convertible<std::result_of<P(const A&)>,bool>::value>, class = std::enable_if< std::is_same<Future<A>,std::result_of<F(const A&)> >::value>>
Future<A> casa::vi::Future< A >::iterateUntil ( p,
F &&  f 
) const
inline

Definition at line 209 of file Future.h.

References casa::vi::Future< A >::iterateWhile().

template<typename A >
template<typename P , typename F , class = std::enable_if< std::is_convertible<std::result_of<P(const A&)>,bool>::value>, class = std::enable_if< std::is_same<Future<A>,std::result_of<F(const A&)> >::value>>
Future<A> casa::vi::Future< A >::iterateWhile ( p,
f 
) const
inline

Definition at line 228 of file Future.h.

Referenced by casa::vi::Future< A >::iterateUntil().

template<typename A >
template<typename F , typename B = typename std::result_of<F(const A&)>::type>
static std::function<Future<B>const Future<A>&)> casa::vi::Future< A >::lift ( f)
inlinestatic

Definition at line 120 of file Future.h.

template<typename A >
template<typename F , typename B = typename std::result_of<F(const A&)>::type>
Future<B> casa::vi::Future< A >::map ( fn) const
inline
template<typename A >
template<typename F , typename FB = typename std::result_of<F()>::type, class = std::enable_if<std::is_base_of<FutureBase,FB>::value>>
FB casa::vi::Future< A >::operator>> ( F &&  fn) const
inline

Definition at line 319 of file Future.h.

References casa::vi::Future< A >::followedBy().

template<typename A >
template<typename F , typename FB = typename std::result_of<F(const A&)>::type, class = std::enable_if<std::is_base_of<FutureBase,FB>::value>>
FB casa::vi::Future< A >::operator>>= ( F &&  fn) const
inline

Definition at line 307 of file Future.h.

References casa::vi::Future< A >::flatMap().

template<typename A >
template<typename F , typename B = typename std::result_of<F(const A&)>::type>
Future<B> casa::vi::Future< A >::operator| ( F &&  fn) const
inline

Definition at line 331 of file Future.h.

References casa::vi::Future< A >::map().

template<typename A >
template<typename F , class = std::enable_if< std::is_convertible< std::result_of<F(std::exception_ptr &)>,A>::value>>
Future<A> casa::vi::Future< A >::recoverWith ( fn) const
inline

Definition at line 266 of file Future.h.

References casa::vi::Future< A >::m_fta.

template<typename A >
void casa::vi::Future< A >::wait ( ) const
inline

Definition at line 279 of file Future.h.

References casa::vi::Future< A >::m_fta.

template<typename A >
template<class Rep , class Period >
std::future_status casa::vi::Future< A >::waitFor ( const std::chrono::duration< Rep, Period > &  rel_time) const
inline

Definition at line 287 of file Future.h.

References casa::vi::Future< A >::m_fta.

template<typename A >
template<class Clock , class Duration >
std::future_status casa::vi::Future< A >::waitUntil ( const std::chrono::time_point< Clock, Duration > &  abs_time) const
inline

Definition at line 295 of file Future.h.

References casa::vi::Future< A >::m_fta.

Member Data Documentation

template<typename A >
std::shared_future<Try<A> > casa::vi::Future< A >::m_fta
private

The documentation for this class was generated from the following file: