USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-gaea0e2de
UHD and USRP Manual
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 #ifndef INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_HPP
9 #define INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_HPP
10 
11 #include <uhd/transport/bounded_buffer.ipp> //detail
12 
13 namespace uhd { namespace transport {
14 
22 template <typename elem_type> class bounded_buffer
23 {
24 public:
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 
112 private:
114 };
115 
116 }} // namespace uhd::transport
117 
118 #endif /* INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_HPP */
UHD_INLINE bool pop_with_haste(elem_type &elem)
Definition: bounded_buffer.hpp:85
Definition: bounded_buffer.hpp:22
bounded_buffer(size_t capacity)
Definition: bounded_buffer.hpp:29
UHD_INLINE bool push_with_haste(const elem_type &elem)
Definition: bounded_buffer.hpp:40
UHD_INLINE bool pop_with_timed_wait(elem_type &elem, double timeout)
Definition: bounded_buffer.hpp:107
Definition: build_info.hpp:13
#define UHD_INLINE
Definition: config.h:53
UHD_INLINE bool push_with_timed_wait(const elem_type &elem, double timeout)
Definition: bounded_buffer.hpp:74
UHD_INLINE void push_with_wait(const elem_type &elem)
Definition: bounded_buffer.hpp:62
UHD_INLINE bool push_with_pop_on_full(const elem_type &elem)
Definition: bounded_buffer.hpp:52
Definition: bounded_buffer.ipp:22
UHD_INLINE void pop_with_wait(elem_type &elem)
Definition: bounded_buffer.hpp:95