libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
qi::FutureSync< T > Class Template Reference

#include <future_fwd.hpp>

Public Types

using ValueType = typename Future< T >::ValueType
 
using ValueTypeCast = typename Future< T >::ValueTypeCast
 
using Connection = typename Future< T >::Connection
 

Public Member Functions

 FutureSync ()
 
 FutureSync (const Future< T > &b)
 
 FutureSync (const FutureSync< T > &b)
 
 FutureSync (const ValueType &v)
 
FutureSync< T > & operator= (const FutureSync< T > &b)
 
FutureSync< T > & operator= (const Future< T > &b)
 
 ~FutureSync () QI_NOEXCEPT(false)
 
 operator Future< T > ()
 
bool operator< (const FutureSync< T > &b) const
 
FutureUniqueId uniqueId () const
 
const ValueTypevalue (int msecs=FutureTimeout_Infinite) const
 
ValueType valueCopy (int msecs=FutureTimeout_Infinite) const
 
boost::shared_ptr< const T > valueSharedPtr (int msecs=FutureTimeout_Infinite) const
 
 operator const typename Future< T >::ValueTypeCast & () const
 
FutureState wait (int msecs=FutureTimeout_Infinite) const
 
FutureState wait (qi::Duration duration) const
 
FutureState waitFor (qi::Duration duration) const
 
FutureState wait (qi::SteadyClock::time_point timepoint) const
 
FutureState waitUntil (qi::SteadyClock::time_point timepoint) const
 
bool isValid () const
 
bool isRunning () const
 
bool isFinished () const
 
bool isCanceled () const
 
bool hasError (int msecs=FutureTimeout_Infinite) const
 
bool hasValue (int msecs=FutureTimeout_Infinite) const
 
const std::string & error (int msecs=FutureTimeout_Infinite) const
 
void cancel ()
 
bool isCancelable () const
 
void connect (const Connection &s)
 
void _connect (const boost::function< void()> &s)
 
template<typename FUNCTYPE , typename ARG0 >
void connect (FUNCTYPE fun, ARG0 tracked,...)
 
Future< T > async ()
 

Protected Attributes

bool _sync
 
Future< T > _future
 

Friends

class Future< T >
 

Detailed Description

template<typename T>
class qi::FutureSync< T >

This class allow throwing on error and being synchronous when the future is not handled by the client.

This class should only be used as return type. If you want to store it, use qi::Future.

Definition at line 70 of file future_fwd.hpp.

Member Typedef Documentation

template<typename T>
using qi::FutureSync< T >::Connection = typename Future<T>::Connection

Definition at line 650 of file future_fwd.hpp.

template<typename T>
using qi::FutureSync< T >::ValueType = typename Future<T>::ValueType

Definition at line 648 of file future_fwd.hpp.

template<typename T>
using qi::FutureSync< T >::ValueTypeCast = typename Future<T>::ValueTypeCast

Definition at line 649 of file future_fwd.hpp.

Constructor & Destructor Documentation

template<typename T>
qi::FutureSync< T >::FutureSync ( )
inline

Definition at line 652 of file future_fwd.hpp.

template<typename T>
qi::FutureSync< T >::FutureSync ( const Future< T > &  b)
inline

Definition at line 654 of file future_fwd.hpp.

template<typename T>
qi::FutureSync< T >::FutureSync ( const FutureSync< T > &  b)
inline

Definition at line 660 of file future_fwd.hpp.

template<typename T>
qi::FutureSync< T >::FutureSync ( const ValueType v)
inlineexplicit

Definition at line 667 of file future_fwd.hpp.

template<typename T>
qi::FutureSync< T >::~FutureSync ( )
inline

will block until the future returns if the future is kept synchronous

Warning
this will throw if the future returns an error

Definition at line 693 of file future_fwd.hpp.

Member Function Documentation

template<typename T>
void qi::FutureSync< T >::_connect ( const boost::function< void()> &  s)
inline

Definition at line 764 of file future_fwd.hpp.

template<typename T>
Future<T> qi::FutureSync< T >::async ( )
inline

Definition at line 784 of file future_fwd.hpp.

template<typename T>
void qi::FutureSync< T >::cancel ( )
inline

Definition at line 761 of file future_fwd.hpp.

template<typename T>
void qi::FutureSync< T >::connect ( const Connection s)
inline

Definition at line 763 of file future_fwd.hpp.

template<typename T>
template<typename FUNCTYPE , typename ARG0 >
void qi::FutureSync< T >::connect ( FUNCTYPE  fun,
ARG0  tracked,
  ... 
)

Connect a callback with binding and tracking support.

If the first argument is a weak_ptr or a pointer inheriting from qi::Trackable, the callback will not be called if tracked object was destroyed.

template<typename T>
const std::string& qi::FutureSync< T >::error ( int  msecs = FutureTimeout_Infinite) const
inline

Definition at line 760 of file future_fwd.hpp.

template<typename T>
bool qi::FutureSync< T >::hasError ( int  msecs = FutureTimeout_Infinite) const
inline

Definition at line 758 of file future_fwd.hpp.

template<typename T>
bool qi::FutureSync< T >::hasValue ( int  msecs = FutureTimeout_Infinite) const
inline

Definition at line 759 of file future_fwd.hpp.

template<typename T>
bool qi::FutureSync< T >::isCancelable ( ) const
inline

Definition at line 762 of file future_fwd.hpp.

template<typename T>
bool qi::FutureSync< T >::isCanceled ( ) const
inline

Definition at line 757 of file future_fwd.hpp.

template<typename T>
bool qi::FutureSync< T >::isFinished ( ) const
inline

Definition at line 756 of file future_fwd.hpp.

template<typename T>
bool qi::FutureSync< T >::isRunning ( ) const
inline

Definition at line 755 of file future_fwd.hpp.

template<typename T>
bool qi::FutureSync< T >::isValid ( ) const
inline

Definition at line 754 of file future_fwd.hpp.

template<typename T>
qi::FutureSync< T >::operator const typename Future< T >::ValueTypeCast & ( ) const
inline

Definition at line 748 of file future_fwd.hpp.

template<typename T>
qi::FutureSync< T >::operator Future< T > ( )
inline

Definition at line 727 of file future_fwd.hpp.

template<typename T>
bool qi::FutureSync< T >::operator< ( const FutureSync< T > &  b) const
inline

Definition at line 732 of file future_fwd.hpp.

template<typename T>
FutureSync<T>& qi::FutureSync< T >::operator= ( const FutureSync< T > &  b)
inline

Definition at line 675 of file future_fwd.hpp.

template<typename T>
FutureSync<T>& qi::FutureSync< T >::operator= ( const Future< T > &  b)
inline

Definition at line 683 of file future_fwd.hpp.

template<typename T>
FutureUniqueId qi::FutureSync< T >::uniqueId ( ) const
inline

Definition at line 737 of file future_fwd.hpp.

template<typename T>
const ValueType& qi::FutureSync< T >::value ( int  msecs = FutureTimeout_Infinite) const
inline

Definition at line 742 of file future_fwd.hpp.

template<typename T>
ValueType qi::FutureSync< T >::valueCopy ( int  msecs = FutureTimeout_Infinite) const
inline

Definition at line 743 of file future_fwd.hpp.

template<typename T>
boost::shared_ptr<const T> qi::FutureSync< T >::valueSharedPtr ( int  msecs = FutureTimeout_Infinite) const
inline

Definition at line 744 of file future_fwd.hpp.

template<typename T>
FutureState qi::FutureSync< T >::wait ( int  msecs = FutureTimeout_Infinite) const
inline

Definition at line 749 of file future_fwd.hpp.

template<typename T>
FutureState qi::FutureSync< T >::wait ( qi::Duration  duration) const
inline

Definition at line 750 of file future_fwd.hpp.

template<typename T>
FutureState qi::FutureSync< T >::wait ( qi::SteadyClock::time_point  timepoint) const
inline

Definition at line 752 of file future_fwd.hpp.

template<typename T>
FutureState qi::FutureSync< T >::waitFor ( qi::Duration  duration) const
inline

Definition at line 751 of file future_fwd.hpp.

template<typename T>
FutureState qi::FutureSync< T >::waitUntil ( qi::SteadyClock::time_point  timepoint) const
inline

Definition at line 753 of file future_fwd.hpp.

Friends And Related Function Documentation

template<typename T>
friend class Future< T >
friend

Definition at line 793 of file future_fwd.hpp.

Member Data Documentation

template<typename T>
Future<T> qi::FutureSync< T >::_future
protected

Definition at line 792 of file future_fwd.hpp.

template<typename T>
bool qi::FutureSync< T >::_sync
mutableprotected

Definition at line 791 of file future_fwd.hpp.


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