RxCpp
The Reactive Extensions for Native (RxCpp) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in both C and C++.
Public Types | Public Member Functions | Friends | List of all members
rxcpp::schedulers::worker Class Reference

#include <rx-scheduler.hpp>

Inheritance diagram for rxcpp::schedulers::worker:
Inheritance graph
[legend]
Collaboration diagram for rxcpp::schedulers::worker:
Collaboration graph
[legend]

Public Types

typedef scheduler_base::clock_type clock_type
 
typedef composite_subscription::weak_subscription weak_subscription
 
- Public Types inherited from rxcpp::schedulers::worker_base
typedef tag_worker worker_tag
 
- Public Types inherited from rxcpp::subscription_base
typedef tag_subscription subscription_tag
 

Public Member Functions

 worker ()
 
 worker (composite_subscription cs, detail::const_worker_interface_ptr i)
 
 worker (composite_subscription cs, worker o)
 
const composite_subscriptionget_subscription () const
 
composite_subscriptionget_subscription ()
 
bool is_subscribed () const
 
weak_subscription add (subscription s) const
 
void remove (weak_subscription w) const
 
void clear () const
 
void unsubscribe () const
 
clock_type::time_point now () const
 return the current time for this worker More...
 
void schedule (const schedulable &scbl) const
 insert the supplied schedulable to be run as soon as possible More...
 
void schedule (clock_type::time_point when, const schedulable &scbl) const
 insert the supplied schedulable to be run at the time specified More...
 
void schedule (clock_type::duration when, const schedulable &scbl) const
 insert the supplied schedulable to be run at now() + the delay specified More...
 
void schedule_periodically (clock_type::time_point initial, clock_type::duration period, const schedulable &scbl) const
 
void schedule_periodically (clock_type::duration initial, clock_type::duration period, const schedulable &scbl) const
 
template<class Arg0 , class... ArgN>
auto schedule (Arg0 &&a0, ArgN &&...an) const -> typename std::enable_if< (detail::is_action_function< Arg0 >::value|| is_subscription< Arg0 >::value)&& !is_schedulable< Arg0 >::value >::type
 use the supplied arguments to make a schedulable and then insert it to be run More...
 
template<class... ArgN>
void schedule_rebind (const schedulable &scbl, ArgN &&...an) const
 use the supplied arguments to make a schedulable and then insert it to be run More...
 
template<class Arg0 , class... ArgN>
auto schedule (clock_type::time_point when, Arg0 &&a0, ArgN &&...an) const -> typename std::enable_if< (detail::is_action_function< Arg0 >::value|| is_subscription< Arg0 >::value)&& !is_schedulable< Arg0 >::value >::type
 use the supplied arguments to make a schedulable and then insert it to be run More...
 
template<class... ArgN>
void schedule_rebind (clock_type::time_point when, const schedulable &scbl, ArgN &&...an) const
 use the supplied arguments to make a schedulable and then insert it to be run More...
 
template<class Arg0 , class... ArgN>
auto schedule_periodically (clock_type::time_point initial, clock_type::duration period, Arg0 &&a0, ArgN &&...an) const -> typename std::enable_if< (detail::is_action_function< Arg0 >::value|| is_subscription< Arg0 >::value)&& !is_schedulable< Arg0 >::value >::type
 use the supplied arguments to make a schedulable and then insert it to be run More...
 
template<class... ArgN>
void schedule_periodically_rebind (clock_type::time_point initial, clock_type::duration period, const schedulable &scbl, ArgN &&...an) const
 use the supplied arguments to make a schedulable and then insert it to be run More...
 

Friends

class weak_worker
 
bool operator== (const worker &, const worker &)
 

Detailed Description

a worker ensures that all scheduled actions on the same instance are executed in-order with no overlap a worker ensures that all scheduled actions are unsubscribed when it is unsubscribed some inner implementations will impose additional constraints on the execution of items.

Member Typedef Documentation

Constructor & Destructor Documentation

rxcpp::schedulers::worker::worker ( )
inline
rxcpp::schedulers::worker::worker ( composite_subscription  cs,
detail::const_worker_interface_ptr  i 
)
inline
rxcpp::schedulers::worker::worker ( composite_subscription  cs,
worker  o 
)
inline

Member Function Documentation

weak_subscription rxcpp::schedulers::worker::add ( subscription  s) const
inline
void rxcpp::schedulers::worker::clear ( ) const
inline
const composite_subscription& rxcpp::schedulers::worker::get_subscription ( ) const
inline
composite_subscription& rxcpp::schedulers::worker::get_subscription ( )
inline
bool rxcpp::schedulers::worker::is_subscribed ( ) const
inline
clock_type::time_point rxcpp::schedulers::worker::now ( ) const
inline

return the current time for this worker

void rxcpp::schedulers::worker::remove ( weak_subscription  w) const
inline
void rxcpp::schedulers::worker::schedule ( const schedulable scbl) const
inline

insert the supplied schedulable to be run as soon as possible

void rxcpp::schedulers::worker::schedule ( clock_type::time_point  when,
const schedulable scbl 
) const
inline

insert the supplied schedulable to be run at the time specified

void rxcpp::schedulers::worker::schedule ( clock_type::duration  when,
const schedulable scbl 
) const
inline

insert the supplied schedulable to be run at now() + the delay specified

template<class Arg0 , class... ArgN>
auto rxcpp::schedulers::worker::schedule ( Arg0 &&  a0,
ArgN &&...  an 
) const -> typename std::enable_if< (detail::is_action_function<Arg0>::value || is_subscription<Arg0>::value) && !is_schedulable<Arg0>::value>::type

use the supplied arguments to make a schedulable and then insert it to be run

template<class Arg0 , class... ArgN>
auto rxcpp::schedulers::worker::schedule ( clock_type::time_point  when,
Arg0 &&  a0,
ArgN &&...  an 
) const -> typename std::enable_if< (detail::is_action_function<Arg0>::value || is_subscription<Arg0>::value) && !is_schedulable<Arg0>::value>::type

use the supplied arguments to make a schedulable and then insert it to be run

void rxcpp::schedulers::worker::schedule_periodically ( clock_type::time_point  initial,
clock_type::duration  period,
const schedulable scbl 
) const
inline

insert the supplied schedulable to be run at the initial time specified and then again at initial + (N * period) this will continue until the worker or schedulable is unsubscribed.

void rxcpp::schedulers::worker::schedule_periodically ( clock_type::duration  initial,
clock_type::duration  period,
const schedulable scbl 
) const
inline

insert the supplied schedulable to be run at now() + the initial delay specified and then again at now() + initial + (N * period) this will continue until the worker or schedulable is unsubscribed.

template<class Arg0 , class... ArgN>
auto rxcpp::schedulers::worker::schedule_periodically ( clock_type::time_point  initial,
clock_type::duration  period,
Arg0 &&  a0,
ArgN &&...  an 
) const -> typename std::enable_if< (detail::is_action_function<Arg0>::value || is_subscription<Arg0>::value) && !is_schedulable<Arg0>::value>::type

use the supplied arguments to make a schedulable and then insert it to be run

template<class... ArgN>
void rxcpp::schedulers::worker::schedule_periodically_rebind ( clock_type::time_point  initial,
clock_type::duration  period,
const schedulable scbl,
ArgN &&...  an 
) const

use the supplied arguments to make a schedulable and then insert it to be run

template<class... ArgN>
void rxcpp::schedulers::worker::schedule_rebind ( const schedulable scbl,
ArgN &&...  an 
) const

use the supplied arguments to make a schedulable and then insert it to be run

template<class... ArgN>
void rxcpp::schedulers::worker::schedule_rebind ( clock_type::time_point  when,
const schedulable scbl,
ArgN &&...  an 
) const

use the supplied arguments to make a schedulable and then insert it to be run

void rxcpp::schedulers::worker::unsubscribe ( ) const
inline

Friends And Related Function Documentation

bool operator== ( const worker lhs,
const worker rhs 
)
friend
friend class weak_worker
friend

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