UHD 003.002.004
include/uhd/transport/bounded_buffer.hpp
Go to the documentation of this file.
00001 //
00002 // Copyright 2010-2011 Ettus Research LLC
00003 //
00004 // This program is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 //
00017 
00018 #ifndef INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_HPP
00019 #define INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_HPP
00020 
00021 #include <uhd/transport/bounded_buffer.ipp> //detail
00022 
00023 namespace uhd{ namespace transport{
00024 
00032     template <typename elem_type> class bounded_buffer{
00033     public:
00034 
00039         bounded_buffer(size_t capacity):
00040             _detail(capacity)
00041         {
00042             /* NOP */
00043         }
00044 
00051         UHD_INLINE bool push_with_haste(const elem_type &elem){
00052             return _detail.push_with_haste(elem);
00053         }
00054 
00062         UHD_INLINE bool push_with_pop_on_full(const elem_type &elem){
00063             return _detail.push_with_pop_on_full(elem);
00064         }
00065 
00071         UHD_INLINE void push_with_wait(const elem_type &elem){
00072             return _detail.push_with_wait(elem);
00073         }
00074 
00082         UHD_INLINE bool push_with_timed_wait(const elem_type &elem, double timeout){
00083             return _detail.push_with_timed_wait(elem, timeout);
00084         }
00085 
00092         UHD_INLINE bool pop_with_haste(elem_type &elem){
00093             return _detail.pop_with_haste(elem);
00094         }
00095 
00101         UHD_INLINE void pop_with_wait(elem_type &elem){
00102             return _detail.pop_with_wait(elem);
00103         }
00104 
00112         UHD_INLINE bool pop_with_timed_wait(elem_type &elem, double timeout){
00113             return _detail.pop_with_timed_wait(elem, timeout);
00114         }
00115 
00116     private: bounded_buffer_detail<elem_type> _detail;
00117     };
00118 
00119 }} //namespace
00120 
00121 #endif /* INCLUDED_UHD_TRANSPORT_BOUNDED_BUFFER_HPP */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines