USRP Hardware Driver and USRP Manual  Version: 3.15.0.0-4+b1satnogs1
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>
24 {
25 public:
30  bounded_buffer(size_t capacity) : _detail(capacity)
31  {
32  /* NOP */
33  }
34 
41  UHD_INLINE bool push_with_haste(const elem_type& elem)
42  {
43  return _detail.push_with_haste(elem);
44  }
45 
53  UHD_INLINE bool push_with_pop_on_full(const elem_type& elem)
54  {
55  return _detail.push_with_pop_on_full(elem);
56  }
57 
63  UHD_INLINE void push_with_wait(const elem_type& elem)
64  {
65  return _detail.push_with_wait(elem);
66  }
67 
75  UHD_INLINE bool push_with_timed_wait(const elem_type& elem, double timeout)
76  {
77  return _detail.push_with_timed_wait(elem, timeout);
78  }
79 
86  UHD_INLINE bool pop_with_haste(elem_type& elem)
87  {
88  return _detail.pop_with_haste(elem);
89  }
90 
96  UHD_INLINE void pop_with_wait(elem_type& elem)
97  {
98  return _detail.pop_with_wait(elem);
99  }
100 
108  UHD_INLINE bool pop_with_timed_wait(elem_type& elem, double timeout)
109  {
110  return _detail.pop_with_timed_wait(elem, timeout);
111  }
112 
113 private:
115 };
116 
117 }} // namespace uhd::transport
118 
119 #endif /* INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_HPP */
Definition: bounded_buffer.ipp:23
Definition: bounded_buffer.hpp:24
UHD_INLINE bool push_with_haste(const elem_type &elem)
Definition: bounded_buffer.hpp:41
bounded_buffer(size_t capacity)
Definition: bounded_buffer.hpp:30
UHD_INLINE bool push_with_timed_wait(const elem_type &elem, double timeout)
Definition: bounded_buffer.hpp:75
UHD_INLINE bool pop_with_timed_wait(elem_type &elem, double timeout)
Definition: bounded_buffer.hpp:108
UHD_INLINE void pop_with_wait(elem_type &elem)
Definition: bounded_buffer.hpp:96
UHD_INLINE bool pop_with_haste(elem_type &elem)
Definition: bounded_buffer.hpp:86
UHD_INLINE bool push_with_pop_on_full(const elem_type &elem)
Definition: bounded_buffer.hpp:53
UHD_INLINE void push_with_wait(const elem_type &elem)
Definition: bounded_buffer.hpp:63
#define UHD_INLINE
Definition: config.h:53
Definition: build_info.hpp:13