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 | List of all members
rxcpp::observer< T, State, OnNext, OnError, OnCompleted > Class Template Reference

consumes values from an observable using State that may implement on_next, on_error and on_completed with optional overrides of each function. More...

#include <rx-observer.hpp>

Inheritance diagram for rxcpp::observer< T, State, OnNext, OnError, OnCompleted >:
Inheritance graph
[legend]
Collaboration diagram for rxcpp::observer< T, State, OnNext, OnError, OnCompleted >:
Collaboration graph
[legend]

Public Types

using this_type = observer< T, State, OnNext, OnError, OnCompleted >
 
using state_t = rxu::decay_t< State >
 
using on_next_t = typename std::conditional< !std::is_same< void, OnNext >::value, rxu::decay_t< OnNext >, detail::OnNextForward< T, State, OnNext >>::type
 
using on_error_t = typename std::conditional< !std::is_same< void, OnError >::value, rxu::decay_t< OnError >, detail::OnErrorForward< State, OnError >>::type
 
using on_completed_t = typename std::conditional< !std::is_same< void, OnCompleted >::value, rxu::decay_t< OnCompleted >, detail::OnCompletedForward< State, OnCompleted >>::type
 
- Public Types inherited from rxcpp::observer_base< T >
typedef T value_type
 
typedef tag_observer observer_tag
 

Public Member Functions

 observer (state_t s, on_next_t n=on_next_t(), on_error_t e=on_error_t(), on_completed_t c=on_completed_t())
 
 observer (state_t s, on_next_t n, on_completed_t c)
 
 observer (const this_type &o)
 
 observer (this_type &&o)
 
this_typeoperator= (this_type o)
 
void on_next (T &t) const
 
void on_next (T &&t) const
 
void on_error (std::exception_ptr e) const
 
void on_completed () const
 
observer< T > as_dynamic () const
 

Detailed Description

template<class T, class State, class OnNext, class OnError, class OnCompleted>
class rxcpp::observer< T, State, OnNext, OnError, OnCompleted >

consumes values from an observable using State that may implement on_next, on_error and on_completed with optional overrides of each function.

Template Parameters
T- the type of value in the stream
State- the type of the stored state
OnNext- the type of a function that matches void(State&, T). Called 0 or more times. If void State::on_next will be called.
OnError- the type of a function that matches void(State&, std::exception_ptr). Called 0 or 1 times, no further calls will be made. If void State::on_error will be called.
OnCompleted- the type of a function that matches void(State&). Called 0 or 1 times, no further calls will be made. If void State::on_completed will be called.

Member Typedef Documentation

template<class T, class State, class OnNext, class OnError, class OnCompleted>
using rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::on_completed_t = typename std::conditional< !std::is_same<void, OnCompleted>::value, rxu::decay_t<OnCompleted>, detail::OnCompletedForward<State, OnCompleted>>::type
template<class T, class State, class OnNext, class OnError, class OnCompleted>
using rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::on_error_t = typename std::conditional< !std::is_same<void, OnError>::value, rxu::decay_t<OnError>, detail::OnErrorForward<State, OnError>>::type
template<class T, class State, class OnNext, class OnError, class OnCompleted>
using rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::on_next_t = typename std::conditional< !std::is_same<void, OnNext>::value, rxu::decay_t<OnNext>, detail::OnNextForward<T, State, OnNext>>::type
template<class T, class State, class OnNext, class OnError, class OnCompleted>
using rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::state_t = rxu::decay_t<State>
template<class T, class State, class OnNext, class OnError, class OnCompleted>
using rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::this_type = observer<T, State, OnNext, OnError, OnCompleted>

Constructor & Destructor Documentation

template<class T, class State, class OnNext, class OnError, class OnCompleted>
rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::observer ( state_t  s,
on_next_t  n = on_next_t(),
on_error_t  e = on_error_t(),
on_completed_t  c = on_completed_t() 
)
inlineexplicit
template<class T, class State, class OnNext, class OnError, class OnCompleted>
rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::observer ( state_t  s,
on_next_t  n,
on_completed_t  c 
)
inlineexplicit
template<class T, class State, class OnNext, class OnError, class OnCompleted>
rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::observer ( const this_type o)
inline
template<class T, class State, class OnNext, class OnError, class OnCompleted>
rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::observer ( this_type &&  o)
inline

Member Function Documentation

template<class T, class State, class OnNext, class OnError, class OnCompleted>
observer<T> rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::as_dynamic ( ) const
inline
template<class T, class State, class OnNext, class OnError, class OnCompleted>
void rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::on_completed ( ) const
inline
template<class T, class State, class OnNext, class OnError, class OnCompleted>
void rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::on_error ( std::exception_ptr  e) const
inline
template<class T, class State, class OnNext, class OnError, class OnCompleted>
void rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::on_next ( T &  t) const
inline
template<class T, class State, class OnNext, class OnError, class OnCompleted>
void rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::on_next ( T &&  t) const
inline
template<class T, class State, class OnNext, class OnError, class OnCompleted>
this_type& rxcpp::observer< T, State, OnNext, OnError, OnCompleted >::operator= ( this_type  o)
inline

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