8 #ifndef INCLUDED_UHD_TRANSPORT_ZERO_COPY_HPP 9 #define INCLUDED_UHD_TRANSPORT_ZERO_COPY_HPP 13 #include <boost/detail/atomic_count.hpp> 14 #include <boost/intrusive_ptr.hpp> 15 #include <boost/shared_ptr.hpp> 16 #include <boost/utility.hpp> 18 namespace uhd {
namespace transport {
26 #ifdef UHD_TXRX_DEBUG_PRINTS 27 _mb_num = s_buffer_count;
40 virtual void release(
void) = 0;
57 return static_cast<T
>(_buffer);
75 return boost::intrusive_ptr<T>(p);
79 typedef boost::intrusive_ptr<managed_buffer>
sptr;
83 return (
int)_ref_count;
86 #ifdef UHD_TXRX_DEBUG_PRINTS 96 #ifdef UHD_TXRX_DEBUG_PRINTS 101 #ifdef UHD_TXRX_DEBUG_PRINTS 102 static boost::detail::atomic_count s_buffer_count;
125 typedef boost::intrusive_ptr<managed_recv_buffer>
sptr;
136 typedef boost::intrusive_ptr<managed_send_buffer>
sptr;
169 typedef boost::shared_ptr<zero_copy_if>
sptr;
188 virtual size_t get_num_recv_frames(
void)
const = 0;
195 virtual size_t get_recv_frame_size(
void)
const = 0;
209 virtual size_t get_num_send_frames(
void)
const = 0;
216 virtual size_t get_send_frame_size(
void)
const = 0;
Simple managed buffer with release interface.
Definition: zero_copy.hpp:21
UHD_INLINE T cast(void) const
Definition: zero_copy.hpp:55
size_t recv_buff_size
Definition: zero_copy.hpp:157
boost::intrusive_ptr< managed_buffer > sptr
Definition: zero_copy.hpp:79
size_t recv_frame_size
Definition: zero_copy.hpp:153
UHD_INLINE void intrusive_ptr_release(managed_buffer *p)
Definition: zero_copy.hpp:111
boost::noncopyable noncopyable
Definition: noncopyable.hpp:46
UHD_INLINE void commit(size_t num_bytes)
Definition: zero_copy.hpp:46
virtual void release(void)=0
size_t send_frame_size
Definition: zero_copy.hpp:154
Definition: zero_copy.hpp:142
size_t num_recv_frames
Definition: zero_copy.hpp:155
boost::shared_ptr< zero_copy_if > sptr
Definition: zero_copy.hpp:169
Definition: zero_copy.hpp:133
zero_copy_xport_params()
Definition: zero_copy.hpp:144
Definition: build_info.hpp:13
Definition: zero_copy.hpp:122
UHD_INLINE size_t size(void) const
Definition: zero_copy.hpp:64
boost::detail::atomic_count _ref_count
Definition: zero_copy.hpp:78
UHD_INLINE void intrusive_ptr_add_ref(managed_buffer *p)
Definition: zero_copy.hpp:106
#define UHD_INLINE
Definition: config.h:53
#define UHD_API
Definition: config.h:68
size_t send_buff_size
Definition: zero_copy.hpp:158
boost::intrusive_ptr< managed_recv_buffer > sptr
Definition: zero_copy.hpp:125
UHD_INLINE boost::intrusive_ptr< T > make(T *p, void *buffer, size_t length)
Create smart pointer to a reusable managed buffer.
Definition: zero_copy.hpp:71
Definition: zero_copy.hpp:166
virtual ~zero_copy_if()
Definition: zero_copy.hpp:174
virtual ~managed_buffer(void)
Definition: zero_copy.hpp:33
boost::intrusive_ptr< managed_send_buffer > sptr
Definition: zero_copy.hpp:136
managed_buffer(void)
Definition: zero_copy.hpp:24
int ref_count()
Definition: zero_copy.hpp:81
size_t _length
Definition: zero_copy.hpp:95
void * _buffer
Definition: zero_copy.hpp:94
size_t num_send_frames
Definition: zero_copy.hpp:156