
Memory blob. More...
Public Member Functions | |
| blob () BOND_NOEXCEPT | |
| Default constructor. | |
| blob (const void *content, uint32_t length) | |
| Construct from a raw pointer to memory buffer. | |
| blob (const boost::shared_ptr< const char[]> &buffer, uint32_t length) | |
| Construct from a boost::shared_ptr to const memory buffer. | |
| blob (const boost::shared_ptr< const char[]> &buffer, uint32_t offset, uint32_t length) | |
| Construct from a boost::shared_ptr to const memory buffer. | |
| blob (const boost::shared_ptr< char[]> &buffer, uint32_t length) | |
| Construct from a boost::shared_ptr to memory buffer. | |
| blob (const boost::shared_ptr< char[]> &buffer, uint32_t offset, uint32_t length) | |
| Construct from a boost::shared_ptr to memory buffer. | |
| template<typename T, template< typename U > class SmartPtr> | |
| blob (const SmartPtr< T > &buffer, uint32_t length) | |
| Construct from a smart pointer other than boost::shared_ptr. | |
| template<typename T, template< typename U > class SmartPtr> | |
| blob (const SmartPtr< T > &buffer, uint32_t offset, uint32_t length) | |
| Construct from a smart pointer other than boost::shared_ptr. | |
| blob (blob &&that) BOND_NOEXCEPT_IF(std | |
| Move constructor. | |
| void | assign (const blob &from, uint32_t offset, uint32_t length) |
| Assign a new value from another blob object or its part. | |
| template<typename T> | |
| void | assign (const T &buffer, uint32_t length) |
| Assign a new value from a raw or smart pointer. | |
| template<typename T> | |
| void | assign (const T &buffer, uint32_t offset, uint32_t length) |
| Assign a new value from a raw or smart pointer. | |
| blob | range (uint32_t offset, uint32_t length) const |
| Return a blob object for a range of this object. | |
| blob | range (uint32_t offset) const |
| Return a blob object for a range from the specified offset to the end of the buffer. | |
| void | swap (blob &src) BOND_NOEXCEPT |
| Swap with another blob. | |
| void | clear () BOND_NOEXCEPT |
| Clear reference to the underlying memory buffer and reset the blob to empty. | |
| const char * | content () const BOND_NOEXCEPT |
| Pointer to the content. | |
| const void * | data () const BOND_NOEXCEPT |
| Void pointer to the content. | |
| uint32_t | length () const BOND_NOEXCEPT |
| Length of the content. | |
| uint32_t | size () const BOND_NOEXCEPT |
| Length of the content. | |
| bool | empty () const BOND_NOEXCEPT |
| Check if the blob is empty (i.e. lenght == 0) | |
| const_iterator | begin () const BOND_NOEXCEPT |
| Iterator for the beginning of the blob. | |
| const_iterator | end () const BOND_NOEXCEPT |
| Iterator for the end of the blob. | |
Friends | |
| template<typename A> | |
| blob | blob_prolong (blob src, const A &allocator) |
| Returns a blob with a copy of the data if the original one does not own the memory (i.e. constructed using raw memory), and the same blob otherwise. | |
Memory blob.
| bond::blob::blob | ( | ) |
Default constructor.
| bond::blob::blob | ( | const void * | content, |
| uint32_t | length ) |
Construct from a raw pointer to memory buffer.
Not recommended because of buffer lifetime management.
| bond::blob::blob | ( | const boost::shared_ptr< const char[]> & | buffer, |
| uint32_t | length ) |
Construct from a boost::shared_ptr to const memory buffer.
| bond::blob::blob | ( | const boost::shared_ptr< const char[]> & | buffer, |
| uint32_t | offset, | ||
| uint32_t | length ) |
Construct from a boost::shared_ptr to const memory buffer.
| bond::blob::blob | ( | const boost::shared_ptr< char[]> & | buffer, |
| uint32_t | length ) |
Construct from a boost::shared_ptr to memory buffer.
| bond::blob::blob | ( | const boost::shared_ptr< char[]> & | buffer, |
| uint32_t | offset, | ||
| uint32_t | length ) |
Construct from a boost::shared_ptr to memory buffer.
| bond::blob::blob | ( | const SmartPtr< T > & | buffer, |
| uint32_t | length ) |
Construct from a smart pointer other than boost::shared_ptr.
Not recommended for performance reasons. Use boost::shared_ptr whenever possible.
| bond::blob::blob | ( | const SmartPtr< T > & | buffer, |
| uint32_t | offset, | ||
| uint32_t | length ) |
Construct from a smart pointer other than boost::shared_ptr.
Not recommended for performance reasons. Use boost::shared_ptr whenever possible.
| bond::blob::blob | ( | blob && | that | ) |
Move constructor.
| void bond::blob::assign | ( | const blob & | from, |
| uint32_t | offset, | ||
| uint32_t | length ) |
Assign a new value from another blob object or its part.
| void bond::blob::assign | ( | const T & | buffer, |
| uint32_t | length ) |
Assign a new value from a raw or smart pointer.
| void bond::blob::assign | ( | const T & | buffer, |
| uint32_t | offset, | ||
| uint32_t | length ) |
Assign a new value from a raw or smart pointer.
| const_iterator bond::blob::begin | ( | ) | const |
Iterator for the beginning of the blob.
| void bond::blob::clear | ( | ) |
Clear reference to the underlying memory buffer and reset the blob to empty.
| const char * bond::blob::content | ( | ) | const |
Pointer to the content.
| const void * bond::blob::data | ( | ) | const |
Void pointer to the content.
| bool bond::blob::empty | ( | ) | const |
Check if the blob is empty (i.e. lenght == 0)
| const_iterator bond::blob::end | ( | ) | const |
Iterator for the end of the blob.
| uint32_t bond::blob::length | ( | ) | const |
Length of the content.
| blob bond::blob::range | ( | uint32_t | offset | ) | const |
Return a blob object for a range from the specified offset to the end of the buffer.
| blob bond::blob::range | ( | uint32_t | offset, |
| uint32_t | length ) const |
Return a blob object for a range of this object.
| uint32_t bond::blob::size | ( | ) | const |
Length of the content.
| void bond::blob::swap | ( | blob & | src | ) |
Swap with another blob.