Loading...
Searching...
No Matches
bounded_buffer.hpp
Go to the documentation of this file.
//
// Copyright 2010-2011 Ettus Research LLC
// Copyright 2018 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/transport/bounded_buffer.ipp> //detail
namespace uhd { namespace transport {
template <typename elem_type>
class bounded_buffer
{
public:
bounded_buffer(size_t capacity) : _detail(capacity)
{
/* NOP */
}
UHD_INLINE bool push_with_haste(const elem_type& elem)
{
return _detail.push_with_haste(elem);
}
UHD_INLINE bool push_with_pop_on_full(const elem_type& elem)
{
return _detail.push_with_pop_on_full(elem);
}
UHD_INLINE void push_with_wait(const elem_type& elem)
{
return _detail.push_with_wait(elem);
}
UHD_INLINE bool push_with_timed_wait(const elem_type& elem, double timeout)
{
return _detail.push_with_timed_wait(elem, timeout);
}
UHD_INLINE bool pop_with_haste(elem_type& elem)
{
return _detail.pop_with_haste(elem);
}
UHD_INLINE void pop_with_wait(elem_type& elem)
{
return _detail.pop_with_wait(elem);
}
UHD_INLINE bool pop_with_timed_wait(elem_type& elem, double timeout)
{
return _detail.pop_with_timed_wait(elem, timeout);
}
UHD_INLINE std::vector<elem_type> pop_all()
{
return _detail.pop_all();
}
private:
bounded_buffer_detail<elem_type> _detail;
};
}} // namespace uhd::transport
bounded_buffer.ipp
uhd::transport::bounded_buffer_detail
Definition bounded_buffer.ipp:22
uhd::transport::bounded_buffer::push_with_haste
UHD_INLINE bool push_with_haste(const elem_type &elem)
Definition bounded_buffer.hpp:40
uhd::transport::bounded_buffer::bounded_buffer
bounded_buffer(size_t capacity)
Definition bounded_buffer.hpp:29
uhd::transport::bounded_buffer::push_with_timed_wait
UHD_INLINE bool push_with_timed_wait(const elem_type &elem, double timeout)
Definition bounded_buffer.hpp:74
uhd::transport::bounded_buffer::pop_with_timed_wait
UHD_INLINE bool pop_with_timed_wait(elem_type &elem, double timeout)
Definition bounded_buffer.hpp:107
uhd::transport::bounded_buffer::pop_all
UHD_INLINE std::vector< elem_type > pop_all()
Definition bounded_buffer.hpp:117
uhd::transport::bounded_buffer::pop_with_wait
UHD_INLINE void pop_with_wait(elem_type &elem)
Definition bounded_buffer.hpp:95
uhd::transport::bounded_buffer::pop_with_haste
UHD_INLINE bool pop_with_haste(elem_type &elem)
Definition bounded_buffer.hpp:85
uhd::transport::bounded_buffer::push_with_pop_on_full
UHD_INLINE bool push_with_pop_on_full(const elem_type &elem)
Definition bounded_buffer.hpp:52
uhd::transport::bounded_buffer::push_with_wait
UHD_INLINE void push_with_wait(const elem_type &elem)
Definition bounded_buffer.hpp:62
UHD_INLINE
#define UHD_INLINE
Definition config.h:65
uhd::transport
Definition adapter_id.hpp:11
uhd
Definition build_info.hpp:12