Template Class PcBuffer#

Inheritance Relationships#

Base Types#

Class Documentation#

template<std::size_t depth, typename element_t = std::byte, std::size_t alignment = sizeof(element_t), class Lock = NoopLock>
class PcBuffer : public Coral::PcBufferWriter<PcBuffer<depth, std::byte, sizeof(std::byte), NoopLock>, std::byte>, public Coral::PcBufferReader<PcBuffer<depth, std::byte, sizeof(std::byte), NoopLock>, std::byte>#

Public Types

using ServiceCallback = std::function<void(PcBuffer<depth, element_t, alignment, Lock>*)>#

Public Functions

inline PcBuffer(bool _auto_service = false, ServiceCallback _space_available = nullptr, ServiceCallback _data_available = nullptr)#
inline void set_space_available(ServiceCallback _space_available = nullptr)#
inline void set_data_available(ServiceCallback _data_available = nullptr)#
inline bool empty(void)#
inline bool full(void)#
inline void clear()#
inline element_t peek()#
inline Result pop_impl(element_t &elem)#
inline Result pop_n_impl(element_t *elem_array, std::size_t count)#
inline std::size_t try_pop_n_impl(element_t *elem_array, std::size_t count)#
inline std::size_t pop_all_impl(element_t *elem_array = nullptr)#
inline Result push_impl(const element_t elem, bool drop = false)#
inline void push_blocking_impl(const element_t elem)#
inline void flush(void)#
inline Result push_n_impl(const element_t *elem_array, std::size_t count, bool drop = false)#
inline std::size_t try_push_n_impl(const element_t *elem_array, std::size_t count)#
inline void push_n_blocking_impl(const element_t *elem_array, std::size_t count)#
inline const element_t *head(void)#

Public Members

PcBufferState state#

Public Static Attributes

static constexpr std::size_t Depth = depth#

Protected Functions

inline void service_data(bool required = false)#
inline void service_space(bool required = false)#

Protected Attributes

CircularBuffer<depth, element_t, alignment> buffer#
ServiceCallback space_available#
ServiceCallback data_available#
bool auto_service#