C++ Actor Framework 0.18
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
caf::intrusive::fifo_inbox< Policy > Class Template Reference

A FIFO inbox that combines an efficient thread-safe LIFO inbox with a FIFO queue for re-ordering incoming messages. More...

#include <fifo_inbox.hpp>

Public Types

using policy_type = Policy
 
using queue_type = typename policy_type::queue_type
 
using deficit_type = typename policy_type::deficit_type
 
using value_type = typename policy_type::mapped_type
 
using lifo_inbox_type = lifo_inbox< policy_type >
 
using pointer = value_type *
 
using unique_pointer = typename queue_type::unique_pointer
 
using node_pointer = typename value_type::node_pointer
 

Public Member Functions

template<class... Ts>
 fifo_inbox (Ts &&... xs)
 
size_t size () noexcept
 Returns an approximation of the current size.
 
bool empty () const noexcept
 Queries whether the inbox is empty.
 
bool closed () const noexcept
 Queries whether this inbox is closed.
 
bool blocked () const noexcept
 Queries whether this has been marked as blocked, i.e., the owner of the list is waiting for new data.
 
inbox_result push_back (pointer ptr) noexcept
 Appends ptr to the inbox.
 
inbox_result push_back (unique_pointer ptr) noexcept
 Appends ptr to the inbox.
 
template<class... Ts>
inbox_result emplace_back (Ts &&... xs)
 
void flush_cache () noexcept
 
bool fetch_more ()
 Tries to get more items from the inbox.
 
bool try_block ()
 Tries to set this queue from empty to blocked.
 
bool try_unblock ()
 Tries to set this queue from blocked to empty.
 
void close ()
 Closes this inbox and moves all elements to the queue.
 
template<class F >
new_round_result new_round (deficit_type quantum, F &consumer)
 Run a new round with quantum, dispatching all tasks to consumer.
 
pointer peek () noexcept
 
template<class Predicate >
pointer find_if (Predicate pred)
 Tries to find an element in the queue that matches the given predicate.
 
queue_type & queue () noexcept
 
template<class Mutex , class CondVar >
bool synchronized_push_back (Mutex &mtx, CondVar &cv, pointer ptr)
 
template<class Mutex , class CondVar >
bool synchronized_push_back (Mutex &mtx, CondVar &cv, unique_pointer ptr)
 
template<class Mutex , class CondVar , class... Ts>
bool synchronized_emplace_back (Mutex &mtx, CondVar &cv, Ts &&... xs)
 
template<class Mutex , class CondVar >
void synchronized_await (Mutex &mtx, CondVar &cv)
 
template<class Mutex , class CondVar , class TimePoint >
bool synchronized_await (Mutex &mtx, CondVar &cv, const TimePoint &timeout)
 

Detailed Description

template<class Policy>
class caf::intrusive::fifo_inbox< Policy >

A FIFO inbox that combines an efficient thread-safe LIFO inbox with a FIFO queue for re-ordering incoming messages.

Member Function Documentation

◆ close()

template<class Policy >
void caf::intrusive::fifo_inbox< Policy >::close ( )

Closes this inbox and moves all elements to the queue.

Warning
Call only from the reader (owner).

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