|
libqi-api
release-2.5.3-2016-11-18
|
#include <strand.hpp>
Public Types | |
| using | Queue = std::deque< boost::shared_ptr< Callback >> |
Public Member Functions | |
| StrandPrivate (qi::ExecutionContext &eventLoop) | |
| Future< void > | asyncAtImpl (boost::function< void()> cb, qi::SteadyClockTimePoint tp) override |
| Future< void > | asyncDelayImpl (boost::function< void()> cb, qi::Duration delay) override |
| boost::shared_ptr< Callback > | createCallback (boost::function< void()> cb) |
| void | enqueue (boost::shared_ptr< Callback > cbStruct) |
| void | process () |
| void | cancel (boost::shared_ptr< Callback > cbStruct) |
| bool | isInThisContext () override |
| return true if the current thread is in this context More... | |
| void | postImpl (boost::function< void()> callback) 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) |
| 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))) |
Public Attributes | |
| qi::ExecutionContext & | _eventLoop |
| std::atomic< unsigned int > | _curId |
| std::atomic< unsigned int > | _aliveCount |
| bool | _processing |
| std::atomic< int > | _processingThread |
| boost::mutex | _mutex |
| boost::condition_variable | _processFinished |
| bool | _dying |
| Queue | _queue |
Additional Inherited Members |
Definition at line 38 of file strand.hpp.
| using qi::StrandPrivate::Queue = std::deque<boost::shared_ptr<Callback>> |
Definition at line 45 of file strand.hpp.
|
inline |
Definition at line 81 of file strand.hpp.
|
inlineoverridevirtual |
call a callback asynchronously to be executed on tp
Implements qi::ExecutionContext.
Definition at line 71 of file strand.hpp.
|
inlineoverridevirtual |
call a callback asynchronously to be executed in delay
Implements qi::ExecutionContext.
Definition at line 73 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 | ) |
| void qi::StrandPrivate::enqueue | ( | boost::shared_ptr< Callback > | cbStruct | ) |
|
inlineoverridevirtual |
return true if the current thread is in this context
Implements qi::ExecutionContext.
Definition at line 69 of file strand.hpp.
|
inlineoverridevirtual |
Implements qi::ExecutionContext.
Definition at line 70 of file strand.hpp.
| void qi::StrandPrivate::process | ( | ) |
| std::atomic<unsigned int> qi::StrandPrivate::_aliveCount |
Definition at line 49 of file strand.hpp.
| std::atomic<unsigned int> qi::StrandPrivate::_curId |
Definition at line 48 of file strand.hpp.
| bool qi::StrandPrivate::_dying |
Definition at line 54 of file strand.hpp.
| qi::ExecutionContext& qi::StrandPrivate::_eventLoop |
Definition at line 47 of file strand.hpp.
| boost::mutex qi::StrandPrivate::_mutex |
Definition at line 52 of file strand.hpp.
| boost::condition_variable qi::StrandPrivate::_processFinished |
Definition at line 53 of file strand.hpp.
| bool qi::StrandPrivate::_processing |
Definition at line 50 of file strand.hpp.
| std::atomic<int> qi::StrandPrivate::_processingThread |
Definition at line 51 of file strand.hpp.
| Queue qi::StrandPrivate::_queue |
Definition at line 55 of file strand.hpp.