USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-ga1b5c4ae
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  public:
24 
29  bounded_buffer(size_t capacity):
30  _detail(capacity)
31  {
32  /* NOP */
33  }
34 
41  UHD_INLINE bool push_with_haste(const elem_type &elem){
42  return _detail.push_with_haste(elem);
43  }
44 
52  UHD_INLINE bool push_with_pop_on_full(const elem_type &elem){
53  return _detail.push_with_pop_on_full(elem);
54  }
55 
61  UHD_INLINE void push_with_wait(const elem_type &elem){
62  return _detail.push_with_wait(elem);
63  }
64 
72  UHD_INLINE bool push_with_timed_wait(const elem_type &elem, double timeout){
73  return _detail.push_with_timed_wait(elem, timeout);
74  }
75 
82  UHD_INLINE bool pop_with_haste(elem_type &elem){
83  return _detail.pop_with_haste(elem);
84  }
85 
91  UHD_INLINE void pop_with_wait(elem_type &elem){
92  return _detail.pop_with_wait(elem);
93  }
94 
102  UHD_INLINE bool pop_with_timed_wait(elem_type &elem, double timeout){
103  return _detail.pop_with_timed_wait(elem, timeout);
104  }
105 
106  private: bounded_buffer_detail<elem_type> _detail;
107  };
108 
109 }} //namespace
110 
111 #endif /* INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_HPP */
UHD_INLINE bool pop_with_haste(elem_type &elem)
Definition: bounded_buffer.hpp:82
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:41
UHD_INLINE bool pop_with_timed_wait(elem_type &elem, double timeout)
Definition: bounded_buffer.hpp:102
Definition: build_info.hpp:14
#define UHD_INLINE
Definition: config.h:53
UHD_INLINE bool push_with_timed_wait(const elem_type &elem, double timeout)
Definition: bounded_buffer.hpp:72
UHD_INLINE void push_with_wait(const elem_type &elem)
Definition: bounded_buffer.hpp:61
UHD_INLINE bool push_with_pop_on_full(const elem_type &elem)
Definition: bounded_buffer.hpp:52
Definition: bounded_buffer.ipp:21
UHD_INLINE void pop_with_wait(elem_type &elem)
Definition: bounded_buffer.hpp:91