载入中...
搜索中...
未找到
eve::rx::Subject< T > 模板类 参考
Multicast push-based stream: both an Observable and a push source. Thread-safe: onNext/onError/onCompleted/subscribe are mutex-protected. 更多...
#include <Rx.h>
类 eve::rx::Subject< T > 继承关系图:
Public 成员函数 | |
| ~Subject () override=default | |
| Subscription | subscribe (Observer< T > obs) override |
| Registers an observer; returns a Subscription that unregisters it. | |
| void | onNext (const T &v) |
| Pushes a value to every registered observer. | |
| void | onError (const std::string &e) |
| Pushes a terminal error and stops the subject. | |
| void | onCompleted () |
| Pushes a terminal completion and stops the subject. | |
| bool | hasObservers () const |
| True while at least one live observer is registered. | |
| int | observerCount () const |
| Number of live (non-disposed) observers. | |
Public 成员函数 继承自 eve::rx::Observable< T > | |
| virtual | ~Observable ()=default |
| Subscription | subscribe (typename Observer< T >::NextFn next) |
| Subscribes with a value callback only. | |
| Subscription | subscribe (typename Observer< T >::NextFn next, typename Observer< T >::ErrorFn error, typename Observer< T >::CompletedFn completed) |
| Subscribes with value/error/completed callbacks. | |
| Observable< T > * | filter (std::function< bool(const T &)> pred) |
| Passes values through only when pred(v) is true. | |
| template<typename R > | |
| Observable< R > * | map (std::function< R(const T &)> fn) |
| Transforms each value with fn. | |
| Observable< T > * | take (int n) |
| Emits at most the first n values, then completes. | |
| Observable< T > * | skip (int n) |
| Drops the first n values. | |
| Observable< T > * | first () |
| Emits only the first value, then completes. | |
| Observable< T > * | takeUntil (Observable< T > *other) |
Stops the stream when other emits or completes. | |
| Observable< T > * | distinctUntilChanged () |
| Suppresses consecutive duplicate values (uses operator==). | |
详细描述
template<typename T>
class eve::rx::Subject< T >
class eve::rx::Subject< T >
Multicast push-based stream: both an Observable and a push source. Thread-safe: onNext/onError/onCompleted/subscribe are mutex-protected.
构造及析构函数说明
◆ ~Subject()
template<typename T >
|
overridedefault |
成员函数说明
◆ hasObservers()
template<typename T >
|
inline |
◆ observerCount()
template<typename T >
|
inline |
◆ onCompleted()
template<typename T >
|
inline |
Pushes a terminal completion and stops the subject.
◆ onError()
template<typename T >
|
inline |
Pushes a terminal error and stops the subject.
◆ onNext()
template<typename T >
|
inline |
Pushes a value to every registered observer.
引用了 eve::rx::Observer< T >::next() , 以及 v.
◆ subscribe()
template<typename T >
|
inlineoverridevirtual |
Registers an observer; returns a Subscription that unregisters it.
该类的文档由以下文件生成:
- src/modules/rx/Rx.h
Public 成员函数 继承自