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

Reads from an observable buffer and emits the consumed items. More...

#include <from_resource.hpp>

Inheritance diagram for caf::flow::op::from_resource_sub< Buffer >:
caf::detail::atomic_ref_counted caf::flow::subscription::impl caf::disposable::impl caf::async::consumer caf::flow::coordinated

Public Types

using value_type = typename Buffer::value_type
 
using buffer_ptr = intrusive_ptr<Buffer>
 
- Public Types inherited from caf::flow::subscription::impl
using handle_type = subscription
 

Public Member Functions

 from_resource_sub (coordinator *parent, buffer_ptr buf, observer< value_type > out)
 
coordinatorparent () const noexcept override
 Returns the coordinator this object lives on.
 
bool disposed () const noexcept override
 
void dispose () override
 
void cancel () override
 Signals that the observer is no longer interested in receiving items.
 
void request (size_t n) override
 Signals demand for n more items.
 
void on_producer_ready () override
 Called to signal that the producer started emitting items.
 
void on_producer_wakeup () override
 Called to signal to the consumer that the producer added an item to a previously empty source or completed the flow of events.
 
void ref_consumer () const noexcept override
 Increases the reference count of the consumer.
 
void deref_consumer () const noexcept override
 Decreases the reference count of the consumer and destroys the object if necessary.
 
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.
 
- Public Member Functions inherited from caf::detail::atomic_ref_counted
 atomic_ref_counted (const atomic_ref_counted &)
 
atomic_ref_countedoperator= (const atomic_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::disposable::impl
disposable as_disposable () noexcept
 

Friends

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

Additional Inherited Members

- Protected Attributes inherited from caf::detail::atomic_ref_counted
std::atomic< size_t > rc_
 

Detailed Description

template<class Buffer>
class caf::flow::op::from_resource_sub< Buffer >

Reads from an observable buffer and emits the consumed items.

Member Function Documentation

◆ cancel()

template<class Buffer >
void caf::flow::op::from_resource_sub< Buffer >::cancel ( )
overridevirtual

Signals that the observer is no longer interested in receiving items.

Only the observer may call this member function. The difference between cancel and dispose is that the latter will call on_complete on the observer if it has not been called yet. Furthermore, dispose has to assume that it has been called from outside of the event loop and thus usually schedules an event to clean up the subscription. In contrast, cancel can assume that it has been called from within the event loop and thus can clean up the subscription immediately.

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

◆ deref_consumer()

template<class Buffer >
void caf::flow::op::from_resource_sub< Buffer >::deref_consumer ( ) const
overridevirtualnoexcept

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

Implements caf::async::consumer.

◆ deref_coordinated()

template<class Buffer >
void caf::flow::op::from_resource_sub< Buffer >::deref_coordinated ( ) const
overridevirtualnoexcept

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

Implements caf::flow::coordinated.

◆ deref_disposable()

template<class Buffer >
void caf::flow::op::from_resource_sub< Buffer >::deref_disposable ( ) const
overridevirtualnoexcept

Implements caf::disposable::impl.

◆ dispose()

template<class Buffer >
void caf::flow::op::from_resource_sub< Buffer >::dispose ( )
overridevirtual

Implements caf::disposable::impl.

◆ disposed()

template<class Buffer >
bool caf::flow::op::from_resource_sub< Buffer >::disposed ( ) const
overridevirtualnoexcept

Implements caf::disposable::impl.

◆ on_producer_ready()

template<class Buffer >
void caf::flow::op::from_resource_sub< Buffer >::on_producer_ready ( )
overridevirtual

Called to signal that the producer started emitting items.

Implements caf::async::consumer.

◆ on_producer_wakeup()

template<class Buffer >
void caf::flow::op::from_resource_sub< Buffer >::on_producer_wakeup ( )
overridevirtual

Called to signal to the consumer that the producer added an item to a previously empty source or completed the flow of events.

Implements caf::async::consumer.

◆ parent()

template<class Buffer >
coordinator * caf::flow::op::from_resource_sub< Buffer >::parent ( ) const
overridevirtualnoexcept

Returns the coordinator this object lives on.

Implements caf::flow::coordinated.

◆ ref_consumer()

template<class Buffer >
void caf::flow::op::from_resource_sub< Buffer >::ref_consumer ( ) const
overridevirtualnoexcept

Increases the reference count of the consumer.

Implements caf::async::consumer.

◆ ref_coordinated()

template<class Buffer >
void caf::flow::op::from_resource_sub< Buffer >::ref_coordinated ( ) const
overridevirtualnoexcept

Increases the reference count of the coordinated.

Implements caf::flow::coordinated.

◆ ref_disposable()

template<class Buffer >
void caf::flow::op::from_resource_sub< Buffer >::ref_disposable ( ) const
overridevirtualnoexcept

Implements caf::disposable::impl.

◆ request()

template<class Buffer >
void caf::flow::op::from_resource_sub< Buffer >::request ( size_t n)
overridevirtual

Signals demand for n more items.

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


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