C++ Actor Framework  0.18
Public Types | Public Member Functions | Static Public Attributes | List of all members
caf::intrusive::wdrr_fixed_multiplexed_queue< Policy, Q, Qs > Class Template Reference

A work queue that internally multiplexes any number of DRR queues. More...

#include <wdrr_fixed_multiplexed_queue.hpp>

Collaboration diagram for caf::intrusive::wdrr_fixed_multiplexed_queue< Policy, Q, Qs >:
Collaboration graph

Public Types

using tuple_type = std::tuple< Q, Qs... >
 
using policy_type = Policy
 
using deficit_type = typename policy_type::deficit_type
 
using value_type = typename policy_type::mapped_type
 
using pointer = value_type *
 
using unique_pointer = typename policy_type::unique_pointer
 
using task_size_type = typename policy_type::task_size_type
 
template<size_t I>
using index = std::integral_constant< size_t, I >
 

Public Member Functions

 wdrr_fixed_multiplexed_queue (policy_type p0, typename Q::policy_type p1, typename Qs::policy_type... ps)
 
policy_type & policy () noexcept
 
const policy_type & policy () const noexcept
 
bool push_back (value_type *ptr) noexcept
 
bool push_back (unique_pointer ptr) noexcept
 
template<class... Ts>
bool emplace_back (Ts &&... xs)
 
void inc_deficit (deficit_type x) noexcept
 
template<class F >
new_round_result new_round (deficit_type quantum, F &f)
 Run a new round with quantum, dispatching all tasks to consumer. More...
 
pointer peek () noexcept
 
template<class Predicate >
pointer find_if (Predicate pred)
 Tries to find an element in the queue that matches the given predicate.
 
template<class F >
void peek_all (F f) const
 Applies f to each element in the queue.
 
bool empty () const noexcept
 Returns true if all queues are empty, false otherwise.
 
void flush_cache () noexcept
 
task_size_type total_task_size () const noexcept
 
tuple_type & queues () noexcept
 Returns the tuple containing all nested queues.
 
const tuple_type & queues () const noexcept
 Returns the tuple containing all nested queues.
 
void lifo_append (pointer ptr) noexcept
 
void stop_lifo_append () noexcept
 

Static Public Attributes

static constexpr size_t num_queues = sizeof...(Qs) + 1
 

Detailed Description

template<class Policy, class Q, class... Qs>
class caf::intrusive::wdrr_fixed_multiplexed_queue< Policy, Q, Qs >

A work queue that internally multiplexes any number of DRR queues.

Member Function Documentation

◆ new_round()

template<class Policy , class Q , class... Qs>
template<class F >
new_round_result caf::intrusive::wdrr_fixed_multiplexed_queue< Policy, Q, Qs >::new_round ( deficit_type  quantum,
F &  f 
)

Run a new round with quantum, dispatching all tasks to consumer.

Returns
true if at least one item was consumed, false otherwise.

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