18 #ifndef INCLUDED_UHD_TRANSPORT_ZERO_COPY_HPP 19 #define INCLUDED_UHD_TRANSPORT_ZERO_COPY_HPP 22 #include <boost/utility.hpp> 23 #include <boost/shared_ptr.hpp> 24 #include <boost/intrusive_ptr.hpp> 25 #include <boost/detail/atomic_count.hpp> 27 namespace uhd{
namespace transport{
39 virtual void release(
void) = 0;
54 return static_cast<T
>(_buffer);
67 T *p,
void *buffer,
size_t length
71 return boost::intrusive_ptr<T>(p);
96 typedef boost::intrusive_ptr<managed_recv_buffer>
sptr;
106 typedef boost::intrusive_ptr<managed_send_buffer>
sptr;
116 typedef boost::shared_ptr<zero_copy_if>
sptr;
130 virtual size_t get_num_recv_frames(
void)
const = 0;
137 virtual size_t get_recv_frame_size(
void)
const = 0;
151 virtual size_t get_num_send_frames(
void)
const = 0;
158 virtual size_t get_send_frame_size(
void)
const = 0;
Simple managed buffer with release interface.
Definition: zero_copy.hpp:30
UHD_INLINE T cast(void) const
Definition: zero_copy.hpp:53
UHD_INLINE void intrusive_ptr_release(managed_buffer *p)
Definition: zero_copy.hpp:85
UHD_INLINE void commit(size_t num_bytes)
Definition: zero_copy.hpp:45
virtual void release(void)=0
boost::shared_ptr< zero_copy_if > sptr
Definition: zero_copy.hpp:116
Definition: zero_copy.hpp:104
#define UHD_API
Definition: config.hpp:76
Definition: convert.hpp:28
Definition: zero_copy.hpp:94
#define UHD_INLINE
Definition: config.hpp:67
UHD_INLINE size_t size(void) const
Definition: zero_copy.hpp:61
boost::detail::atomic_count _ref_count
Definition: zero_copy.hpp:74
UHD_INLINE void intrusive_ptr_add_ref(managed_buffer *p)
Definition: zero_copy.hpp:81
boost::intrusive_ptr< managed_recv_buffer > sptr
Definition: zero_copy.hpp:96
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:66
Definition: zero_copy.hpp:114
boost::intrusive_ptr< managed_send_buffer > sptr
Definition: zero_copy.hpp:106
managed_buffer(void)
Definition: zero_copy.hpp:32
size_t _length
Definition: zero_copy.hpp:78
void * _buffer
Definition: zero_copy.hpp:77