|
C++ Actor Framework 0.19
|
Captures the definition of an observable that has not materialized yet. More...
#include <observable.hpp>
Public Types | |
| using | output_type = output_type_t< Materializer, Steps... > |
Public Member Functions | |
| observable_def (const observable_def &)=delete | |
| observable_def & | operator= (const observable_def &)=delete |
| observable_def (observable_def &&)=default | |
| observable_def & | operator= (observable_def &&)=default |
| template<size_t N = sizeof...(Steps), class = std::enable_if_t<N == 0>> | |
| observable_def (Materializer &&materializer) | |
| observable_def (Materializer &&materializer, std::tuple< Steps... > &&steps) | |
| template<class NewStep > | |
| observable_def< Materializer, Steps..., NewStep > | transform (NewStep step) && |
| Returns a transformation that applies a step function to each input. | |
| template<class Fn > | |
| auto | compose (Fn &&fn) && |
Transforms this observable by applying a function object to it. | |
| auto | skip (size_t n) && |
Returns a transformation that selects all but the first n items. | |
| auto | take (size_t n) && |
Returns a transformation that selects only the first n items. | |
| auto | buffer (size_t count) && |
Emits items in buffers of size count. | |
| auto | buffer (size_t count, timespan period) |
| template<class Predicate > | |
| auto | filter (Predicate predicate) && |
| template<class Predicate > | |
| auto | take_while (Predicate predicate) && |
| template<class Init , class Reducer > | |
| auto | reduce (Init init, Reducer reducer) && |
| auto | sum () && |
| auto | to_vector () && |
| auto | distinct () && |
| template<class F > | |
| auto | map (F f) && |
| template<class F > | |
| auto | do_on_next (F f) && |
| template<class F > | |
| auto | do_on_complete (F f) && |
| template<class F > | |
| auto | do_on_error (F f) && |
| template<class F > | |
| auto | do_finally (F f) && |
| auto | on_error_complete () |
| observable< output_type > | as_observable () && |
| Materializes the observable. | |
| template<class OnNext > | |
| auto | for_each (OnNext on_next) && |
Calls on_next for each item emitted by this observable. | |
| template<class... Inputs> | |
| auto | merge (Inputs &&... xs) && |
| Combines the output of multiple observable objects into one by merging their outputs. | |
| template<class... Inputs> | |
| auto | concat (Inputs &&... xs) && |
| Combines the output of multiple observable objects into one by concatenating their outputs. | |
| template<class F > | |
| auto | flat_map (F f) && |
Returns a transformation that emits items by merging the outputs of all observables returned by f. | |
| template<class F > | |
| auto | concat_map (F f) && |
Returns a transformation that emits items by concatenating the outputs of all observables returned by f. | |
| template<class F , class T0 , class... Ts> | |
| auto | zip_with (F fn, T0 input0, Ts... inputs) |
| Creates an observable that combines the emitted from all passed source observables by applying a function object. | |
| auto | publish () && |
| Convert this observable into a connectable observable. | |
| auto | share (size_t subscriber_threshold=1) && |
Convenience alias for publish().ref_count(subscriber_threshold). | |
| observable< cow_tuple< cow_vector< output_type >, observable< output_type > > > | prefix_and_tail (size_t prefix_size) && |
Takes prefix_size elements from this observable and emits it in a tuple containing an observable for the remaining elements as the second value. | |
| observable< cow_tuple< output_type, observable< output_type > > > | head_and_tail () && |
Similar to prefix_and_tail(1) but passes the single element directly in the tuple instead of wrapping it in a list. | |
| template<class Out > | |
| disposable | subscribe (Out &&out) && |
| Subscribes a new observer to the items emitted by this observable. | |
| async::consumer_resource< output_type > | to_resource () && |
| Creates an asynchronous resource that makes emitted items available in an SPSC buffer. | |
| async::consumer_resource< output_type > | to_resource (size_t buffer_size, size_t min_request_size) && |
| Creates an asynchronous resource that makes emitted items available in an SPSC buffer. | |
| observable< output_type > | observe_on (coordinator *other) && |
| Observes items from this observable on another coordinator. | |
| observable< output_type > | observe_on (coordinator *other, size_t buffer_size, size_t min_request_size) && |
| Observes items from this observable on another coordinator. | |
| bool | valid () const noexcept |
Captures the definition of an observable that has not materialized yet.
| auto caf::flow::observable_def< Materializer, Steps >::buffer | ( | size_t | count | ) | && |
Emits items in buffers of size count.
| auto caf::flow::observable_def< Materializer, Steps >::compose | ( | Fn && | fn | ) | && |
Transforms this observable by applying a function object to it.
| auto caf::flow::observable_def< Materializer, Steps >::concat | ( | Inputs &&... | xs | ) | && |
Combines the output of multiple observable objects into one by concatenating their outputs.
May also be called without arguments if the T is an observable.
| auto caf::flow::observable_def< Materializer, Steps >::concat_map | ( | F | f | ) | && |
Returns a transformation that emits items by concatenating the outputs of all observables returned by f.
| auto caf::flow::observable_def< Materializer, Steps >::flat_map | ( | F | f | ) | && |
Returns a transformation that emits items by merging the outputs of all observables returned by f.
| auto caf::flow::observable_def< Materializer, Steps >::for_each | ( | OnNext | on_next | ) | && |
Calls on_next for each item emitted by this observable.
| observable< cow_tuple< output_type, observable< output_type > > > caf::flow::observable_def< Materializer, Steps >::head_and_tail | ( | ) | && |
Similar to prefix_and_tail(1) but passes the single element directly in the tuple instead of wrapping it in a list.
| auto caf::flow::observable_def< Materializer, Steps >::merge | ( | Inputs &&... | xs | ) | && |
Combines the output of multiple observable objects into one by merging their outputs.
May also be called without arguments if the T is an observable.
| observable< output_type > caf::flow::observable_def< Materializer, Steps >::observe_on | ( | coordinator * | other | ) | && |
Observes items from this observable on another coordinator.
other coordinator must not run at this point. | observable< output_type > caf::flow::observable_def< Materializer, Steps >::observe_on | ( | coordinator * | other, |
| size_t | buffer_size, | ||
| size_t | min_request_size | ||
| ) | && |
Observes items from this observable on another coordinator.
other coordinator must not run at this point. | observable< cow_tuple< cow_vector< output_type >, observable< output_type > > > caf::flow::observable_def< Materializer, Steps >::prefix_and_tail | ( | size_t | prefix_size | ) | && |
Takes prefix_size elements from this observable and emits it in a tuple containing an observable for the remaining elements as the second value.
The returned observable either emits a single element (the tuple) or none if this observable never produces sufficient elements for the prefix.
prefix_size > 0 | auto caf::flow::observable_def< Materializer, Steps >::publish | ( | ) | && |
Convert this observable into a connectable observable.
| auto caf::flow::observable_def< Materializer, Steps >::share | ( | size_t | subscriber_threshold = 1 | ) | && |
Convenience alias for publish().ref_count(subscriber_threshold).
| auto caf::flow::observable_def< Materializer, Steps >::skip | ( | size_t | n | ) | && |
Returns a transformation that selects all but the first n items.
| disposable caf::flow::observable_def< Materializer, Steps >::subscribe | ( | Out && | out | ) | && |
Subscribes a new observer to the items emitted by this observable.
| auto caf::flow::observable_def< Materializer, Steps >::take | ( | size_t | n | ) | && |
Returns a transformation that selects only the first n items.
| async::consumer_resource< output_type > caf::flow::observable_def< Materializer, Steps >::to_resource | ( | ) | && |
Creates an asynchronous resource that makes emitted items available in an SPSC buffer.
| async::consumer_resource< output_type > caf::flow::observable_def< Materializer, Steps >::to_resource | ( | size_t | buffer_size, |
| size_t | min_request_size | ||
| ) | && |
Creates an asynchronous resource that makes emitted items available in an SPSC buffer.
| observable_def< Materializer, Steps..., NewStep > caf::flow::observable_def< Materializer, Steps >::transform | ( | NewStep | step | ) | && |
Returns a transformation that applies a step function to each input.
| auto caf::flow::observable_def< Materializer, Steps >::zip_with | ( | F | fn, |
| T0 | input0, | ||
| Ts... | inputs | ||
| ) |
Creates an observable that combines the emitted from all passed source observables by applying a function object.
| fn | The zip function. Takes one element from each input at a time and reduces them into a single result. |
| input0 | The first additional input. |
| inputs | Additional inputs, if any. |