Type-less observable (or partially untyped) that has the notion of Type but hides the notion of on_subscribe<Type> for C++ compiler. More...
#include <dynamic_observable.hpp>
Public Types | |
using | base = specific_observable< Type, details::dynamic_observable_state< Type > > |
Public Member Functions | |
dynamic_observable (constraint::on_subscribe_fn< Type > auto &&on_subscribe) | |
template<constraint::observable_of_type< Type > TObs> requires (!std::is_same_v<std::decay_t<TObs>, dynamic_observable<Type>>) | |
dynamic_observable (TObs &&observable) | |
Public Member Functions inherited from rpp::specific_observable< Type, details::dynamic_observable_state< Type > > | |
specific_observable (OnSubscribeFn &&on_subscribe) | |
specific_observable (const OnSubscribeFn &on_subscribe) | |
specific_observable (const specific_observable &other)=default | |
specific_observable (specific_observable &&other) noexcept=default | |
specific_observable & | operator= (const specific_observable &other)=default |
specific_observable & | operator= (specific_observable &&other) noexcept=default |
auto | as_dynamic () const & |
Converts rpp::specific_observable to rpp::dynamic_observable via type-erasure mechanism. | |
auto | as_dynamic () && |
Public Member Functions inherited from rpp::interface_observable< Type, specific_observable< Type, OnSubscribeFn > > | |
auto | op (OperatorFn &&fn) const & |
The apply function to observable which returns observable of another type. | |
auto | op (OperatorFn &&fn) && |
auto | as_blocking () const & |
Converts existing observable to rpp::blocking_observable which has another interface and abilities. | |
auto | as_blocking () && |
Type-less observable (or partially untyped) that has the notion of Type but hides the notion of on_subscribe<Type> for C++ compiler.
This is a C++ technique called type-erasure. Multiple instances of the observable<type> that may have different upstream graphs are considered homogeneous. i.e. They can be stored in the same container, e.g. std::vector. As a result, it uses heap to store on_subscribe and hide its type.
Type | is the value type. Observable of type means this source could emit a sequence of items of that "Type". |
This is a C++ technique called type-erasure. Multiple instances of the observable<type> that may have different upstream graphs are considered homogeneous. i.e. They can be stored in the same container, e.g. std::vector. As a result, it uses heap to store on_subscribe and hide its type.
Type | is the value type. Observable of type means this source could emit a sequence of items of that "Type". |