1#ifndef NDNPH_PORT_QUEUE_BOOSTLF_HPP
2#define NDNPH_PORT_QUEUE_BOOSTLF_HPP
4#include "../../core/common.hpp"
6#include <boost/lockfree/spsc_queue.hpp>
9namespace port_queue_boostlf {
12template<
typename T,
size_t capacity>
18 return m_queue.push(item);
21 std::tuple<Item, bool>
pop() {
23 bool ok = m_queue.pop(item);
24 return std::make_tuple(std::move(item), ok);
21 std::tuple<Item, bool>
pop() {
…}
28 using Q =
typename boost::lockfree::spsc_queue<T, boost::lockfree::capacity<capacity>>;
9namespace port_queue_boostlf {
…}
34#ifdef NDNPH_PORT_QUEUE_BOOSTLF
36template<
typename T,
size_t capacity>
37using SafeQueue = port_queue_boostlf::SafeQueue<T, capacity>;
Generic thread-safe queue, implemented with Boost Lockfree library.
Definition boostlf.hpp:13
std::tuple< Item, bool > pop()
Definition boostlf.hpp:21
bool push(Item item)
Definition boostlf.hpp:17
T Item
Definition boostlf.hpp:15