C++ Actor Framework 1.0.0
Loading...
Searching...
No Matches
caf::flow::op::merge_sub< T > Class Template Reference

Receives observables from the pre-merge step and merges their inputs for the observer. More...

#include <merge.hpp>

Inheritance diagram for caf::flow::op::merge_sub< T >:
caf::flow::subscription::impl_base caf::flow::op::pullable caf::detail::plain_ref_counted caf::flow::subscription::impl caf::flow::coordinated

Public Types

using input_key = size_t
 
using input_map = std::map<input_key, merge_input<T>>
 
using input_map_iterator = typename input_map::iterator
 
- Public Types inherited from caf::flow::subscription::impl
using handle_type = subscription
 

Public Member Functions

 merge_sub (coordinator *parent, observer< T > out, size_t max_concurrent, size_t max_pending_per_input=default_max_pending_per_input)
 
coordinatorparent () const noexcept override
 Returns the coordinator this object lives on.
 
void on_next (const observable< T > &what) override
 
void on_error (const error &what) override
 
void on_complete () override
 
void on_subscribe (flow::subscription sub) override
 
void ref_coordinated () const noexcept final
 Increases the reference count of the coordinated.
 
void deref_coordinated () const noexcept final
 Decreases the reference count of the coordinated and destroys the object if necessary.
 
void fwd_on_subscribe (input_key key, subscription sub)
 
void fwd_on_complete (input_key key)
 
void fwd_on_error (input_key key, const error &what)
 
void fwd_on_next (input_key key, const T &item)
 
bool disposed () const noexcept override
 
void request (size_t n) override
 Signals demand for n more items.
 
size_t buffered () const noexcept
 
size_t demand () const noexcept
 
size_t num_inputs () const noexcept
 
bool subscribed () const noexcept
 
size_t max_concurrent () const noexcept
 
- Public Member Functions inherited from caf::flow::subscription::impl_base
void ref_disposable () const noexcept override
 
void deref_disposable () const noexcept override
 
void ref_coordinated () const noexcept override
 Increases the reference count of the coordinated.
 
void deref_coordinated () const noexcept override
 Decreases the reference count of the coordinated and destroys the object if necessary.
 
void dispose () final
 
void cancel () final
 Signals that the observer is no longer interested in receiving items.
 
- Public Member Functions inherited from caf::detail::plain_ref_counted
 plain_ref_counted (const plain_ref_counted &)
 
plain_ref_countedoperator= (const plain_ref_counted &)
 
void ref () const noexcept
 Increases reference count by one.
 
void deref () const noexcept
 Decreases reference count by one and calls request_deletion when it drops to zero.
 
bool unique () const noexcept
 Queries whether there is exactly one reference.
 
size_t get_reference_count () const noexcept
 Queries the current reference count for this object.
 
- Public Member Functions inherited from caf::flow::op::pullable
 pullable (const pullable &)=delete
 
pullableoperator= (const pullable &)=delete
 
bool is_pulling () const noexcept
 Checks whether this operator is currently running do_pull or is scheduled to do so.
 

Static Public Attributes

static constexpr size_t default_max_pending_per_input = 8
 Limits how many items the merge operator pulls in per input.
 

Friends

void intrusive_ptr_add_ref (const merge_sub *ptr) noexcept
 
void intrusive_ptr_release (const merge_sub *ptr) noexcept
 

Additional Inherited Members

- Protected Member Functions inherited from caf::flow::op::pullable
void pull (flow::coordinator *parent, size_t n)
 
- Protected Attributes inherited from caf::detail::plain_ref_counted
size_t rc_
 

Detailed Description

template<class T>
class caf::flow::op::merge_sub< T >

Receives observables from the pre-merge step and merges their inputs for the observer.

Member Function Documentation

◆ deref_coordinated()

template<class T >
void caf::flow::op::merge_sub< T >::deref_coordinated ( ) const
finalvirtualnoexcept

Decreases the reference count of the coordinated and destroys the object if necessary.

Implements caf::flow::coordinated.

◆ parent()

template<class T >
coordinator * caf::flow::op::merge_sub< T >::parent ( ) const
overridevirtualnoexcept

Returns the coordinator this object lives on.

Implements caf::flow::coordinated.

◆ ref_coordinated()

template<class T >
void caf::flow::op::merge_sub< T >::ref_coordinated ( ) const
finalvirtualnoexcept

Increases the reference count of the coordinated.

Implements caf::flow::coordinated.

◆ request()

template<class T >
void caf::flow::op::merge_sub< T >::request ( size_t n)
overridevirtual

Signals demand for n more items.

Implements caf::flow::subscription::impl.

Member Data Documentation

◆ default_max_pending_per_input

template<class T >
size_t caf::flow::op::merge_sub< T >::default_max_pending_per_input = 8
staticconstexpr

Limits how many items the merge operator pulls in per input.

This is deliberately small to make sure that we get reasonably small "batches" of items per input to make sure all inputs get their turn.


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