USRP Hardware Driver and USRP Manual: bounded_buffer.hpp Source File

| USRP Hardware Driver and USRP Manual Version: 4.8.0.makepkg-0-g308126a4 UHD and USRP Manual |

Loading...
Searching...
No Matches
bounded_buffer.hpp
Go to the documentation of this file.
1//
2// Copyright 2010-2011 Ettus Research LLC
3// Copyright 2018 Ettus Research, a National Instruments Company
4//
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
7
8#pragma once
9
10#include <uhd/transport/bounded_buffer.ipp> //detail
11
12namespace uhd { namespace transport {
13
21template <typename elem_type>
22 class bounded_buffer
23{
24public:
29 bounded_buffer(size_t capacity) : _detail(capacity)
30 {
31 /* NOP */
32 }
33
40 UHD_INLINE bool push_with_haste(const elem_type& elem)
41 {
42 return _detail.push_with_haste(elem);
43 }
44
52 UHD_INLINE bool push_with_pop_on_full(const elem_type& elem)
53 {
54 return _detail.push_with_pop_on_full(elem);
55 }
56
62 UHD_INLINE void push_with_wait(const elem_type& elem)
63 {
64 return _detail.push_with_wait(elem);
65 }
66
74 UHD_INLINE bool push_with_timed_wait(const elem_type& elem, double timeout)
75 {
76 return _detail.push_with_timed_wait(elem, timeout);
77 }
78
85 UHD_INLINE bool pop_with_haste(elem_type& elem)
86 {
87 return _detail.pop_with_haste(elem);
88 }
89
95 UHD_INLINE void pop_with_wait(elem_type& elem)
96 {
97 return _detail.pop_with_wait(elem);
98 }
99
107 UHD_INLINE bool pop_with_timed_wait(elem_type& elem, double timeout)
108 {
109 return _detail.pop_with_timed_wait(elem, timeout);
110 }
111
112private:
113 bounded_buffer_detail<elem_type> _detail;
114};
115
116}} // 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_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