proxygen
|
#include <Observer.h>
Public Member Functions | |
virtual void | onNext (const T &)=0 |
virtual void | onError (Error)=0 |
virtual void | onCompleted ()=0 |
virtual | ~Observer ()=default |
Static Public Member Functions | |
template<class N , class E , class C > | |
static std::unique_ptr< Observer > | create (N &&onNextFn, E &&onErrorFn, C &&onCompletedFn) |
template<class N , class E > | |
static std::unique_ptr< Observer > | create (N &&onNextFn, E &&onErrorFn) |
template<class N > | |
static std::unique_ptr< Observer > | create (N &&onNextFn) |
Observer interface. You can subclass it, or you can just use create() to use std::functions.
Definition at line 32 of file Observer.h.
|
virtualdefault |
|
inlinestatic |
Create an Observer with std::function callbacks. Handy to make ad-hoc Observers with lambdas.
Templated for maximum perfect forwarding flexibility, but ultimately whatever you pass in has to implicitly become a std::function for the same signature as onNext(), onError(), and onCompleted() respectively. (see the FunctionObserver typedefs)
Definition at line 48 of file Observer.h.
Referenced by incrementer(), makeCOObserver(), makeMOObserver(), makeObserver(), and TEST().
|
inlinestatic |
Create an Observer with only onNext and onError callbacks. onCompleted will just be a no-op.
Definition at line 60 of file Observer.h.
|
inlinestatic |
Create an Observer with only an onNext callback. onError and onCompleted will just be no-ops.
Definition at line 70 of file Observer.h.
|
pure virtual |
Implemented in wangle::FunctionObserver< T >, and wangle::Subject< T >.
Referenced by wangle::Subject< T >::onCompleted().
|
pure virtual |
Implemented in wangle::FunctionObserver< T >, and wangle::Subject< T >.
Referenced by wangle::Subject< T >::onError().
|
pure virtual |
Implemented in wangle::FunctionObserver< T >, and wangle::Subject< T >.
Referenced by wangle::Subject< T >::onNext().