UHD
003.005.000-31-stable
|
Simple managed buffer with release interface. More...
#include <zero_copy.hpp>
Public Member Functions | |
managed_buffer (void) | |
virtual void | release (void)=0 |
UHD_INLINE void | commit (size_t num_bytes) |
template<class T > | |
UHD_INLINE T | cast (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. | |
Public Attributes | |
boost::detail::atomic_count | _ref_count |
Protected Attributes | |
void * | _buffer |
size_t | _length |
Simple managed buffer with release interface.
uhd::transport::managed_buffer::managed_buffer | ( | void | ) | [inline] |
UHD_INLINE T uhd::transport::managed_buffer::cast | ( | void | ) | const [inline] |
Get a pointer to the underlying buffer.
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).
num_bytes | the number of bytes written into the buffer |
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.
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.
UHD_INLINE size_t uhd::transport::managed_buffer::size | ( | void | ) | const [inline] |
Get the size of the underlying buffer.
void* uhd::transport::managed_buffer::_buffer [protected] |
size_t uhd::transport::managed_buffer::_length [protected] |
boost::detail::atomic_count uhd::transport::managed_buffer::_ref_count |