libqi-api  release-2.5.3-2016-11-18
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | List of all members
qi::ExecutionContext Class Referenceabstract

#include <executioncontext.hpp>

Public Member Functions

virtual ~ExecutionContext ()
 
virtual qi::Future< void > async (const boost::function< void()> &callback, qi::SteadyClockTimePoint tp)=0
 
virtual qi::Future< void > async (const boost::function< void()> &callback, qi::Duration delay)=0
 
template<typename R >
boost::disable_if
< std::is_same< R, void >
, qi::Future< R > >::type 
async (const boost::function< R()> &callback, qi::Duration delay)
 
template<typename R >
boost::disable_if
< std::is_same< R, void >
, qi::Future< R > >::type 
async (const boost::function< R()> &callback, qi::SteadyClockTimePoint tp)
 
template<typename R >
qi::Future< R > async (const detail::Function< R()> &callback)
 
template<typename F >
void post (F &&callback)
 post a callback to be executed as soon as possible More...
 
template<typename F >
auto asyncAt (F &&callback, qi::SteadyClockTimePoint tp) -> qi::Future< typename std::decay< decltype(callback())>::type >
 call a callback asynchronously to be executed on tp More...
 
template<typename F >
auto asyncDelay (F &&callback, qi::Duration delay) -> qi::Future< typename std::decay< decltype(callback())>::type >
 call a callback asynchronously to be executed in delay More...
 
template<typename F >
auto async (F &&callback) -> decltype(asyncDelay(std::forward< F >(callback), qi::Duration(0)))
 
virtual bool isInThisContext ()=0
 return true if the current thread is in this context More...
 

Protected Member Functions

virtual void postImpl (boost::function< void()> callback)=0
 
virtual qi::Future< void > asyncAtImpl (boost::function< void()> cb, qi::SteadyClockTimePoint tp)=0
 
virtual qi::Future< void > asyncDelayImpl (boost::function< void()> cb, qi::Duration delay)=0
 

Detailed Description

Definition at line 40 of file executioncontext.hpp.

Constructor & Destructor Documentation

virtual qi::ExecutionContext::~ExecutionContext ( )
inlinevirtual

Definition at line 43 of file executioncontext.hpp.

Member Function Documentation

virtual qi::Future<void> qi::ExecutionContext::async ( const boost::function< void()> &  callback,
qi::SteadyClockTimePoint  tp 
)
pure virtual

call a callback asynchronously to be executed on tp

Deprecated:
since 2.5

Implemented in qi::Strand, qi::EventLoop, and qi::StrandPrivate.

virtual qi::Future<void> qi::ExecutionContext::async ( const boost::function< void()> &  callback,
qi::Duration  delay 
)
pure virtual

call a callback asynchronously to be executed in delay

Deprecated:
since 2.5

Implemented in qi::Strand, qi::EventLoop, and qi::StrandPrivate.

template<typename R >
boost::disable_if< std::is_same< R, void >, qi::Future< R > >::type qi::ExecutionContext::async ( const boost::function< R()> &  callback,
qi::Duration  delay 
)

call a callback asynchronously to be executed in delay

Deprecated:
since 2.5

Definition at line 164 of file executioncontext.hpp.

template<typename R >
boost::disable_if< std::is_same< R, void >, qi::Future< R > >::type qi::ExecutionContext::async ( const boost::function< R()> &  callback,
qi::SteadyClockTimePoint  tp 
)

call a callback asynchronously to be executed on tp

Deprecated:
since 2.5

Definition at line 181 of file executioncontext.hpp.

template<typename R >
qi::Future<R> qi::ExecutionContext::async ( const detail::Function< R()> &  callback)
inline
Deprecated:
since 2.5

Definition at line 71 of file executioncontext.hpp.

template<typename F >
auto qi::ExecutionContext::async ( F &&  callback) -> decltype(asyncDelay(std::forward<F>(callback), qi::Duration(0)))
inline

Definition at line 88 of file executioncontext.hpp.

template<typename F >
auto qi::ExecutionContext::asyncAt ( F &&  callback,
qi::SteadyClockTimePoint  tp 
) -> qi::Future<typename std::decay<decltype(callback())>::type>

call a callback asynchronously to be executed on tp

Definition at line 218 of file executioncontext.hpp.

virtual qi::Future<void> qi::ExecutionContext::asyncAtImpl ( boost::function< void()>  cb,
qi::SteadyClockTimePoint  tp 
)
protectedpure virtual

Implemented in qi::StrandPrivate.

template<typename F >
auto qi::ExecutionContext::asyncDelay ( F &&  callback,
qi::Duration  delay 
) -> qi::Future<typename std::decay<decltype(callback())>::type>

call a callback asynchronously to be executed in delay

Definition at line 232 of file executioncontext.hpp.

virtual qi::Future<void> qi::ExecutionContext::asyncDelayImpl ( boost::function< void()>  cb,
qi::Duration  delay 
)
protectedpure virtual

Implemented in qi::StrandPrivate.

virtual bool qi::ExecutionContext::isInThisContext ( )
pure virtual

return true if the current thread is in this context

Implemented in qi::Strand, qi::StrandPrivate, and qi::EventLoop.

template<typename F >
void qi::ExecutionContext::post ( F &&  callback)

post a callback to be executed as soon as possible

Definition at line 196 of file executioncontext.hpp.

virtual void qi::ExecutionContext::postImpl ( boost::function< void()>  callback)
protectedpure virtual

Implemented in qi::StrandPrivate.


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