USRP Hardware Driver and USRP Manual  Version: 003.008.001-0-g2474ac32
UHD and USRP Manual
uhd::transport::managed_buffer Class Referenceabstract

Simple managed buffer with release interface. More...

#include <uhd/transport/zero_copy.hpp>

Inheritance diagram for uhd::transport::managed_buffer:
uhd::transport::managed_recv_buffer uhd::transport::managed_send_buffer

Public Types

typedef boost::intrusive_ptr< managed_buffersptr
 

Public Member Functions

 managed_buffer (void)
 
virtual ~managed_buffer (void)
 
virtual void release (void)=0
 
UHD_INLINE void commit (size_t num_bytes)
 
template<class T >
UHD_INLINEcast (void) const
 
UHD_INLINE size_t size (void) const
 
template<typename T >
UHD_INLINE boost::intrusive_ptr< T > make (T *p, void *buffer, size_t length)
 Create smart pointer to a reusable managed buffer. More...
 
int ref_count ()
 

Public Attributes

boost::detail::atomic_count _ref_count
 

Protected Attributes

void * _buffer
 
size_t _length
 

Detailed Description

Simple managed buffer with release interface.

Member Typedef Documentation

◆ sptr

Constructor & Destructor Documentation

◆ managed_buffer()

uhd::transport::managed_buffer::managed_buffer ( void  )
inline

◆ ~managed_buffer()

virtual uhd::transport::managed_buffer::~managed_buffer ( void  )
inlinevirtual

Member Function Documentation

◆ cast()

template<class T >
UHD_INLINE T uhd::transport::managed_buffer::cast ( void  ) const
inline

Get a pointer to the underlying buffer.

Returns
a pointer into memory

◆ commit()

UHD_INLINE void uhd::transport::managed_buffer::commit ( size_t  num_bytes)
inline

Use commit() to re-write the length (for use with send buffers).

Parameters
num_bytesthe number of bytes written into the buffer

◆ make()

template<typename T >
UHD_INLINE boost::intrusive_ptr<T> uhd::transport::managed_buffer::make ( T *  p,
void *  buffer,
size_t  length 
)
inline

Create smart pointer to a reusable managed buffer.

◆ ref_count()

int uhd::transport::managed_buffer::ref_count ( )
inline

◆ release()

virtual void uhd::transport::managed_buffer::release ( void  )
pure virtual

Signal to the transport that we are done with the buffer. This should be called to release the buffer to the transport object. After calling, the referenced memory should be considered invalid.

◆ size()

UHD_INLINE size_t uhd::transport::managed_buffer::size ( void  ) const
inline

Get the size of the underlying buffer.

Returns
the number of bytes

Member Data Documentation

◆ _buffer

void* uhd::transport::managed_buffer::_buffer
protected

◆ _length

size_t uhd::transport::managed_buffer::_length
protected

◆ _ref_count

boost::detail::atomic_count uhd::transport::managed_buffer::_ref_count

The documentation for this class was generated from the following file: