ledger-core
Public Member Functions | Static Public Member Functions | List of all members
ledger::core::Future< T > Class Template Reference

Public Member Functions

 Future (const std::shared_ptr< Deffered< T >> &_defer)
 
 Future (const Future< T > &future)
 
 Future (Future< T > &&future)
 
Future< T > & operator= (const Future< T > &future)
 
Future< T > & operator= (Future< T > &&future)
 
template<typename R >
Future< R > map (const Context &context, std::function< R(const T &)> map)
 
template<typename R >
Future< std::shared_ptr< R > > mapPtr (const Context &context, std::function< std::shared_ptr< R >(const T &)> map)
 
template<typename R >
Future< R > flatMap (const Context &context, std::function< Future< R >(const T &)> map)
 
template<typename R >
Future< std::shared_ptr< R > > flatMapPtr (const Context &context, std::function< Future< std::shared_ptr< R >>(const T &)> map)
 
Future< T > recover (const Context &context, std::function< T(const Exception &)> f)
 
Future< T > recoverWith (const Context &context, std::function< Future< T >(const Exception &)> f)
 
Future< T > fallback (const T &fallback)
 
Future< T > fallbackWith (Future< T > fallback)
 
Future< T > filter (const Context &context, std::function< bool(const T &)> f)
 
void foreach (const Context &context, std::function< void(T &)> f)
 
Option< Try< T > > getValue () const
 
bool isCompleted () const
 
Future< Exceptionfailed ()
 
void onComplete (const Context &context, std::function< void(const Try< T > &)> f)
 
template<typename Callback >
std::enable_if< has_on_callback_method< Callback, void(T &)>::value, void >::type callback (const Context &context, std::shared_ptr< Callback > cb)
 
template<typename Callback >
std::enable_if< has_on_callback_method< Callback, void(const std::experimental::optional< T > &, const std::experimental::optional< api::Error > &)>::value, void >::type callback (const Context &context, std::shared_ptr< Callback > cb)
 
template<typename Callback >
std::enable_if< is_shared_ptr< T >::value &&has_on_callback_method< Callback, void(const T &, const std::experimental::optional< api::Error > &)>::value, void >::type callback (const Context &context, std::shared_ptr< Callback > cb)
 

Static Public Member Functions

static Future< T > successful (T value)
 
static Future< T > failure (Exception &&exception)
 
static Future< T > failure (const Exception &exception)
 
static Future< T > async (const Context &context, std::function< T()> f)
 
static Future< T > async (const Context &context, std::function< Future< T >()> f)
 
static std::shared_ptr< Deffered< T > > make_deffered ()
 

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