ReactivePlusPlus
One more implementation of ReactiveX approach in C++ with care about performance and templates in mind
 
Loading...
Searching...
No Matches
rpp::dynamic_observable< Type > Class Template Reference

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>

Inheritance diagram for rpp::dynamic_observable< Type >:
rpp::specific_observable< Type, details::dynamic_observable_state< Type > > rpp::interface_observable< Type, specific_observable< Type, OnSubscribeFn > > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::member_overload< Type, SpecificObservable, MemberTag > rpp::details::typed_observable_tag< Type >

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_observableoperator= (const specific_observable &other)=default
 
specific_observableoperator= (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 () &&
 

Detailed Description

template<constraint::decayed_type Type>
class rpp::dynamic_observable< Type >

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.

Parameters
Typeis 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.

Parameters
Typeis the value type. Observable of type means this source could emit a sequence of items of that "Type".

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