libqi-api  2.8.7.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
qi::ScopedFutureGroup Class Reference

#include <futuregroup.hpp>

Public Member Functions

 ~ScopedFutureGroup ()
 
template<class T >
void add (Future< T > future)
 
void cancelAll ()
 
bool empty () const
 
size_t size () const
 
- Public Member Functions inherited from qi::Trackable< ScopedFutureGroup >
 Trackable ()
 Default constructor. More...
 
 QI_API_DEPRECATED_MSG (Use default constructor instead) Trackable(ScopedFutureGroup *ptr)
 
 ~Trackable ()
 
boost::weak_ptr
< ScopedFutureGroup
weakPtr () const
 
void wait ()
 

Additional Inherited Members

- Protected Member Functions inherited from qi::Trackable< ScopedFutureGroup >
void destroy ()
 

Detailed Description

Cancel a group of unfinished registered futures on destruction. Guarantees that the registered set of futures will be canceled whatever the reason of the destruction of the group.

Remarks
All public member functions are thread-safe unless specified.

Definition at line 20 of file futuregroup.hpp.

Constructor & Destructor Documentation

qi::ScopedFutureGroup::~ScopedFutureGroup ( )
inline

Destructor, cancel all unfinished futures registered.

Definition at line 27 of file futuregroup.hpp.

Member Function Documentation

template<class T >
void qi::ScopedFutureGroup::add ( Future< T >  future)
inline

Register a future to be canceled if not finished when this object is destroyed, or if cancelAll() is called. Futures finishing before cancelation will be automatically unregistered. Non-cancelable futures will be ignored.

Parameters
futureFuture to register.

Definition at line 40 of file futuregroup.hpp.

void qi::ScopedFutureGroup::cancelAll ( )
inline

Cancel all registered futures and unregister them.

Definition at line 48 of file futuregroup.hpp.

bool qi::ScopedFutureGroup::empty ( ) const
inline
Returns
True if there is no future registered, false otherwise.

Definition at line 74 of file futuregroup.hpp.

size_t qi::ScopedFutureGroup::size ( ) const
inline
Returns
Count of registered futures.

Definition at line 80 of file futuregroup.hpp.


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