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

#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

Detailed Description

Definition at line 44 of file strand.hpp.

Member Typedef Documentation

using qi::StrandPrivate::Queue = std::deque<boost::shared_ptr<Callback>>

Definition at line 51 of file strand.hpp.

Constructor & Destructor Documentation

qi::StrandPrivate::StrandPrivate ( qi::ExecutionContext executor)
explicit
qi::StrandPrivate::~StrandPrivate ( )

Member Function Documentation

qi::Future<void> qi::StrandPrivate::async ( const boost::function< void()> &  callback,
qi::SteadyClockTimePoint  tp 
)
inlineoverridevirtual

call a callback asynchronously to be executed on tp

Deprecated:
since 2.5

Implements qi::ExecutionContext.

Definition at line 91 of file strand.hpp.

qi::Future<void> qi::StrandPrivate::async ( const boost::function< void()> &  callback,
qi::Duration  delay 
)
inlineoverridevirtual

call a callback asynchronously to be executed in delay

Deprecated:
since 2.5

Implements qi::ExecutionContext.

Definition at line 94 of file strand.hpp.

Future<void> qi::StrandPrivate::asyncAtImpl ( boost::function< void()>  cb,
qi::SteadyClockTimePoint  tp,
ExecutionOptions  options = defaultExecutionOptions() 
)
overridevirtual

Implements qi::ExecutionContext.

Future<void> qi::StrandPrivate::asyncDelayImpl ( boost::function< void()>  cb,
qi::Duration  delay,
ExecutionOptions  options = defaultExecutionOptions() 
)
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 
)
bool qi::StrandPrivate::isInThisContext ( ) const
overridevirtual

return true if the current thread is in this context

Implements qi::ExecutionContext.

void qi::StrandPrivate::join ( )
void qi::StrandPrivate::postImpl ( boost::function< void()>  callback,
ExecutionOptions  options 
)
inlineoverridevirtual

Implements qi::ExecutionContext.

Definition at line 88 of file strand.hpp.

void qi::StrandPrivate::process ( )

Member Data Documentation

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.


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