Template Class RTERing
Defined in File dpdk_wrappers.h
Template Parameter Order
typename Elem
MbufType type
Class Documentation
-
template<typename Elem, MbufType type = MbufType::Raw>
class RTERing A wrapper around an rte_ring.
Public Types
-
using owning_value_type = RTEMbufElement<Elem, type>
-
using pointer = value_type*
-
using reference = value_type&
Public Functions
-
inline ~RTERing()
Deconstructs the ring, and deallocates all the elements still in the ring.
-
inline std::optional<owning_value_type> enqueue(owning_value_type &&elem)
Enqueues a single element into the queue.
- Parameters:
elem – The element to enqueue.
-
template<size_t N>
inline RTEMbufArray<Elem, N, type> enqueue_burst(RTEMbufArray<Elem, N, type> &&array)
-
inline std::optional<owning_value_type> dequeue()
Dequeues a single element from the queue.
- Returns:
A std::unique_ptr to the dequeued element.
-
inline size_t count() const
- Returns:
The amount of elements enqueued in the ring.
-
inline size_t capacity() const
-
inline size_t free_count() const
-
inline bool empty() const
Public Static Functions
-
static inline tl::expected<RTERing, int> init(const std::string &name, RTEMempool<Elem, type> &mempool, size_t num_elems, unsigned int flags, int socket_id = rte_socket_id())
-
using owning_value_type = RTEMbufElement<Elem, type>