|
libqi-api
2.8.7.4
|
#include <strand.hpp>
Public Types | |
| using | Queue = std::deque< boost::shared_ptr< Callback >> |
Public Member Functions | |
| StrandPrivate (qi::ExecutionContext &executor) | |
| ~StrandPrivate () | |
| void | join () QI_NOEXCEPT(true) |
| Future< void > | asyncAtImpl (boost::function< void()> cb, qi::SteadyClockTimePoint tp, ExecutionOptions options=defaultExecutionOptions()) override |
| Future< void > | asyncDelayImpl (boost::function< void()> cb, qi::Duration delay, ExecutionOptions options=defaultExecutionOptions()) override |
| Future< void > | deferImpl (boost::function< void()> cb, qi::Duration delay, ExecutionOptions options=defaultExecutionOptions()) |
| boost::shared_ptr< Callback > | createCallback (boost::function< void()> cb, ExecutionOptions options) |
| void | enqueue (boost::shared_ptr< Callback > cbStruct, ExecutionOptions options) |
| void | process () |
| void | cancel (boost::shared_ptr< Callback > cbStruct) |
| bool | isInThisContext () const override |
| return true if the current thread is in this context More... | |
| void | postImpl (boost::function< void()> callback, ExecutionOptions options) override |
| qi::Future< void > | async (const boost::function< void()> &callback, qi::SteadyClockTimePoint tp) override |
| qi::Future< void > | async (const boost::function< void()> &callback, qi::Duration delay) override |
Public Member Functions inherited from qi::ExecutionContext | |
| virtual | ~ExecutionContext () |
| 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, ExecutionOptions options=defaultExecutionOptions()) |
| post a callback to be executed as soon as possible More... | |
| template<typename F , typename R = ka::Decay<decltype(std::declval<F>()())>> | |
| qi::Future< R > | asyncAt (F &&callback, qi::SteadyClockTimePoint tp, ExecutionOptions options=defaultExecutionOptions()) |
| call a callback asynchronously to be executed on tp More... | |
| template<typename F , typename R = ka::Decay<decltype(std::declval<F>()())>> | |
| qi::Future< R > | asyncDelay (F &&callback, qi::Duration delay, ExecutionOptions options=defaultExecutionOptions()) |
| call a callback asynchronously to be executed in delay More... | |
| template<typename F > | |
| auto | async (F &&callback, ExecutionOptions options=defaultExecutionOptions()) -> decltype(asyncDelay(std::forward< F >(callback), qi::Duration(0), options)) |
| template<typename F , typename R > | |
| Future< R > | asyncAt (F &&callback, qi::SteadyClockTimePoint tp, ExecutionOptions options) |
| template<typename F , typename R > | |
| Future< R > | asyncDelay (F &&callback, qi::Duration delay, ExecutionOptions options) |
Public Attributes | |
| qi::ExecutionContext & | _executor |
| std::atomic< unsigned int > | _curId |
| std::atomic< unsigned int > | _aliveCount |
| bool | _processing |
| std::atomic< int > | _processingThread |
| boost::recursive_mutex | _mutex |
| boost::condition_variable_any | _processFinished |
| bool | _dying |
| Queue | _queue |
| std::shared_ptr < ScopedPromiseGroup > | _deferredTasksFutures |
Additional Inherited Members |
Definition at line 44 of file strand.hpp.
| using qi::StrandPrivate::Queue = std::deque<boost::shared_ptr<Callback>> |
Definition at line 51 of file strand.hpp.
|
explicit |
| qi::StrandPrivate::~StrandPrivate | ( | ) |
|
inlineoverridevirtual |
call a callback asynchronously to be executed on tp
Implements qi::ExecutionContext.
Definition at line 91 of file strand.hpp.
|
inlineoverridevirtual |
call a callback asynchronously to be executed in delay
Implements qi::ExecutionContext.
Definition at line 94 of file strand.hpp.
|
overridevirtual |
Implements qi::ExecutionContext.
|
overridevirtual |
Implements qi::ExecutionContext.
| void qi::StrandPrivate::cancel | ( | boost::shared_ptr< Callback > | cbStruct | ) |
| boost::shared_ptr<Callback> qi::StrandPrivate::createCallback | ( | boost::function< void()> | cb, |
| ExecutionOptions | options | ||
| ) |
| Future<void> qi::StrandPrivate::deferImpl | ( | boost::function< void()> | cb, |
| qi::Duration | delay, | ||
| ExecutionOptions | options = defaultExecutionOptions() |
||
| ) |
| void qi::StrandPrivate::enqueue | ( | boost::shared_ptr< Callback > | cbStruct, |
| ExecutionOptions | options | ||
| ) |
|
overridevirtual |
return true if the current thread is in this context
Implements qi::ExecutionContext.
| void qi::StrandPrivate::join | ( | ) |
|
inlineoverridevirtual |
Implements qi::ExecutionContext.
Definition at line 88 of file strand.hpp.
| void qi::StrandPrivate::process | ( | ) |
| std::atomic<unsigned int> qi::StrandPrivate::_aliveCount |
Definition at line 55 of file strand.hpp.
| std::atomic<unsigned int> qi::StrandPrivate::_curId |
Definition at line 54 of file strand.hpp.
| std::shared_ptr<ScopedPromiseGroup> qi::StrandPrivate::_deferredTasksFutures |
Definition at line 62 of file strand.hpp.
| bool qi::StrandPrivate::_dying |
Definition at line 60 of file strand.hpp.
| qi::ExecutionContext& qi::StrandPrivate::_executor |
Definition at line 53 of file strand.hpp.
| boost::recursive_mutex qi::StrandPrivate::_mutex |
Definition at line 58 of file strand.hpp.
| boost::condition_variable_any qi::StrandPrivate::_processFinished |
Definition at line 59 of file strand.hpp.
| bool qi::StrandPrivate::_processing |
Definition at line 56 of file strand.hpp.
| std::atomic<int> qi::StrandPrivate::_processingThread |
Definition at line 57 of file strand.hpp.
| Queue qi::StrandPrivate::_queue |
Definition at line 61 of file strand.hpp.