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> 26 namespace uhd{
namespace transport{
31 return boost::intrusive_ptr<T>(p,
false);
41 typedef boost::intrusive_ptr<managed_recv_buffer>
sptr;
48 virtual void release(
void) = 0;
54 template <
class T>
inline T
cast(
void)
const{
55 return static_cast<T
>(this->get_buff());
62 inline size_t size(
void)
const{
63 return this->get_size();
67 virtual const void *get_buff(
void)
const = 0;
68 virtual size_t get_size(
void)
const = 0;
88 typedef boost::intrusive_ptr<managed_send_buffer>
sptr;
96 virtual void commit(
size_t num_bytes) = 0;
102 template <
class T>
inline T
cast(
void)
const{
103 return static_cast<T
>(this->get_buff());
110 inline size_t size(
void)
const{
111 return this->get_size();
115 virtual void *get_buff(
void)
const = 0;
116 virtual size_t get_size(
void)
const = 0;
136 typedef boost::shared_ptr<zero_copy_if>
sptr;
150 virtual size_t get_num_recv_frames(
void)
const = 0;
157 virtual size_t get_recv_frame_size(
void)
const = 0;
171 virtual size_t get_num_send_frames(
void)
const = 0;
178 virtual size_t get_send_frame_size(
void)
const = 0;
UHD_INLINE void intrusive_ptr_release(managed_recv_buffer *p)
Definition: zero_copy.hpp:77
size_t size(void) const
Definition: zero_copy.hpp:62
size_t size(void) const
Definition: zero_copy.hpp:110
boost::shared_ptr< zero_copy_if > sptr
Definition: zero_copy.hpp:136
Definition: zero_copy.hpp:86
#define UHD_API
Definition: config.hpp:76
Definition: convert.hpp:28
UHD_INLINE boost::intrusive_ptr< T > make_managed_buffer(T *p)
Create smart pointer to a reusable managed buffer.
Definition: zero_copy.hpp:29
int _ref_count
Definition: zero_copy.hpp:118
Definition: zero_copy.hpp:39
int _ref_count
Definition: zero_copy.hpp:70
#define UHD_INLINE
Definition: config.hpp:67
UHD_INLINE void intrusive_ptr_add_ref(managed_recv_buffer *p)
Definition: zero_copy.hpp:73
boost::intrusive_ptr< managed_recv_buffer > sptr
Definition: zero_copy.hpp:41
Definition: zero_copy.hpp:134
boost::intrusive_ptr< managed_send_buffer > sptr
Definition: zero_copy.hpp:88
T cast(void) const
Definition: zero_copy.hpp:102
T cast(void) const
Definition: zero_copy.hpp:54
virtual void commit(size_t num_bytes)=0
virtual void release(void)=0