Template Class RTEMbufArray

Nested Relationships

Nested Types

Template Parameter Order

  1. typename Elem

  2. size_t N

  3. MbufType type

Class Documentation

template<typename Elem, size_t N, MbufType type = MbufType::Raw>
class RTEMbufArray

Public Types

using value_type = typename std::conditional<type == MbufType::Raw, Elem, RTEMbuf<Elem>>::type
using owning_value_type = RTEMbufElement<Elem, type>
using pointer = value_type*
using const_pointer = std::add_const_t<pointer>
using double_pointer = pointer*
using reference = value_type&
using const_reference = std::add_const_t<reference>
using Iterator = BaseIterator<value_type, std::forward_iterator_tag>
using ConstIterator = BaseIterator<const value_type, std::forward_iterator_tag>

Public Functions

inline RTEMbufArray(std::span<pointer> span)
inline ~RTEMbufArray()
inline void release()
RTEMbufArray(const RTEMbufArray&) = delete
RTEMbufArray &operator=(const RTEMbufArray&) = delete
inline RTEMbufArray(RTEMbufArray &&other)
inline RTEMbufArray &operator=(RTEMbufArray &&other)
inline RTEMbufArray insert(RTEMbufArray &&other)
inline std::pair<RTEMbufArray, RTEMbufArray> split(size_t index)

Split the array into two.

Parameters:

index – The index into the array to split at. E.g. if index is 7 then first array will have 7 elements and the second size() - 7.

Returns:

An std::pair<RTEPktMbufArray, RTEPktMbufArray>.

inline size_t FromSpan(const std::span<pointer> span)
inline size_t size() const
inline size_t free_cnt() const
inline constexpr size_t capacity() const
inline double_pointer data()
inline reference operator[](size_t i)
inline const_reference operator[](size_t i) const
inline Elem &get_data(size_t i)
inline Elem &get_data(size_t i)
inline const Elem &get_data(size_t i) const
inline const Elem &get_data(size_t i) const
inline Iterator begin()
inline Iterator end()
inline ConstIterator begin() const
inline ConstIterator end() const
inline reference front()
inline reference back()
inline const_reference front() const
inline const_reference back() const
inline std::optional<owning_value_type> pop()
inline std::optional<owning_value_type> push(owning_value_type &&elem)

Public Static Functions

template<typename T>
static inline tl::expected<RTEMbufArray, int> init(RTEMempool<T, type> &mempool, const size_t count, const Elem &value)
template<typename T>
static inline tl::expected<RTEMbufArray, int> init(RTEMempool<T, type> &mempool, const size_t count)
template<typename T>
static inline tl::expected<RTEMbufArray, int> init(RTEMempool<T, type> &mempool)
template<typename value_type_, typename iterator_category_>
struct BaseIterator

Public Types

using iterator_category = iterator_category_
using difference_type = std::ptrdiff_t
using value_type = value_type_
using pointer = value_type*
using double_pointer = pointer*
using reference = value_type&

Public Functions

inline explicit BaseIterator()
inline BaseIterator(double_pointer ptrs_)
inline reference operator*() const
inline pointer operator->() const
inline BaseIterator &operator++()
inline BaseIterator operator++(int)

Friends

inline friend bool operator==(const BaseIterator &a, const BaseIterator &b)
inline friend bool operator!=(const BaseIterator &a, const BaseIterator &b)