21#ifndef IO_MULTIPLEXER_HPP
22#define IO_MULTIPLEXER_HPP
23#include "detail/immovable.hpp"
68 [[nodiscard]]
auto is_empty() const noexcept ->
bool
70 return std::get<0>(head_.
tail) == &head_;
87 if (!other.is_empty())
89 std::get<0>(other.head_.tail)->next = std::get<0>(head_.
tail)->next;
90 std::get<0>(head_.
tail)->next = other.head_.next;
91 head_.
tail = other.head_.tail;
93 other.head_.next = std::get<0>(other.head_.tail) = &other.head_;
100 if (std::get<0>(head_.
tail) == head_.
next)
106 task head_{.next = &head_, .
tail = &head_};
An intrusive queue of tasks.
Definition multiplexer.hpp:42
auto move_back(intrusive_task_queue &&other) noexcept -> void
Moves all tasks from one intrusive queue onto the back of another.
Definition multiplexer.hpp:85
auto push(task *task) noexcept -> void
Pushes a task onto the back of queue.
Definition multiplexer.hpp:74
auto pop() noexcept -> task *
Pops a task from the front of the queue.
Definition multiplexer.hpp:98
auto is_empty() const noexcept -> bool
Checks if the intrusive task queue is empty.
Definition multiplexer.hpp:68
This file defines concepts for the execution components.
Provides high-level interfaces for executors and completion triggers.
Definition executor.hpp:33
An intrusive task that can be executed by the multiplexer.
Definition multiplexer.hpp:45
std::variant< task *, void(*)(task *) noexcept > tail
Tail pointer variant.
Definition multiplexer.hpp:56
auto execute() noexcept -> void
Executes the task.
Definition multiplexer.hpp:64
task * next
Pointer to next in the intrusive queue.
Definition multiplexer.hpp:47
A basic multiplexer that can be used with different event types.
Definition multiplexer.hpp:37
Tag multiplexer_type
The tag type for the multiplexer.
Definition multiplexer.hpp:39