USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-gdca39145
UHD and USRP Manual
bounded_buffer.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2011 Ettus Research LLC
3 //
4 // SPDX-License-Identifier: GPL-3.0
5 //
6 
7 #ifndef INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_HPP
8 #define INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_HPP
9 
10 #include <uhd/transport/bounded_buffer.ipp> //detail
11 
12 namespace uhd{ namespace transport{
13 
21  template <typename elem_type> class bounded_buffer{
22  public:
23 
28  bounded_buffer(size_t capacity):
29  _detail(capacity)
30  {
31  /* NOP */
32  }
33 
40  UHD_INLINE bool push_with_haste(const elem_type &elem){
41  return _detail.push_with_haste(elem);
42  }
43 
51  UHD_INLINE bool push_with_pop_on_full(const elem_type &elem){
52  return _detail.push_with_pop_on_full(elem);
53  }
54 
60  UHD_INLINE void push_with_wait(const elem_type &elem){
61  return _detail.push_with_wait(elem);
62  }
63 
71  UHD_INLINE bool push_with_timed_wait(const elem_type &elem, double timeout){
72  return _detail.push_with_timed_wait(elem, timeout);
73  }
74 
81  UHD_INLINE bool pop_with_haste(elem_type &elem){
82  return _detail.pop_with_haste(elem);
83  }
84 
90  UHD_INLINE void pop_with_wait(elem_type &elem){
91  return _detail.pop_with_wait(elem);
92  }
93 
101  UHD_INLINE bool pop_with_timed_wait(elem_type &elem, double timeout){
102  return _detail.pop_with_timed_wait(elem, timeout);
103  }
104 
105  private: bounded_buffer_detail<elem_type> _detail;
106  };
107 
108 }} //namespace
109 
110 #endif /* INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_HPP */
UHD_INLINE bool pop_with_haste(elem_type &elem)
Definition: bounded_buffer.hpp:81
Definition: bounded_buffer.hpp:21
bounded_buffer(size_t capacity)
Definition: bounded_buffer.hpp:28
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:101
Definition: build_info.hpp:14
#define UHD_INLINE
Definition: config.h:52
UHD_INLINE bool push_with_timed_wait(const elem_type &elem, double timeout)
Definition: bounded_buffer.hpp:71
UHD_INLINE void push_with_wait(const elem_type &elem)
Definition: bounded_buffer.hpp:60
UHD_INLINE bool push_with_pop_on_full(const elem_type &elem)
Definition: bounded_buffer.hpp:51
Definition: bounded_buffer.ipp:20
UHD_INLINE void pop_with_wait(elem_type &elem)
Definition: bounded_buffer.hpp:90