Memory blob. More...
Public Member Functions | |
blob () BOND_NOEXCEPT | |
Default constructor. More... | |
blob (const void *content, uint32_t length) | |
Construct from a raw pointer to memory buffer. More... | |
blob (const boost::shared_ptr< const char[]> &buffer, uint32_t length) | |
Construct from a boost::shared_ptr to const memory buffer. More... | |
blob (const boost::shared_ptr< const char[]> &buffer, uint32_t offset, uint32_t length) | |
Construct from a boost::shared_ptr to const memory buffer. More... | |
blob (const boost::shared_ptr< char[]> &buffer, uint32_t length) | |
Construct from a boost::shared_ptr to memory buffer. More... | |
blob (const boost::shared_ptr< char[]> &buffer, uint32_t offset, uint32_t length) | |
Construct from a boost::shared_ptr to memory buffer. More... | |
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. More... | |
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. More... | |
blob (blob &&that) BOND_NOEXCEPT_IF(std | |
Move constructor. More... | |
void | assign (const blob &from, uint32_t offset, uint32_t length) |
Assign a new value from another blob object or its part. More... | |
template<typename T > | |
void | assign (const T &buffer, uint32_t length) |
Assign a new value from a raw or smart pointer. More... | |
template<typename T > | |
void | assign (const T &buffer, uint32_t offset, uint32_t length) |
Assign a new value from a raw or smart pointer. More... | |
blob | range (uint32_t offset, uint32_t length) const |
Return a blob object for a range of this object. More... | |
blob | range (uint32_t offset) const |
Return a blob object for a range from the specified offset to the end of the buffer. More... | |
void | swap (blob &src) BOND_NOEXCEPT |
Swap with another blob. More... | |
void | clear () BOND_NOEXCEPT |
Clear reference to the underlying memory buffer and reset the blob to empty. More... | |
const char * | content () const BOND_NOEXCEPT |
Pointer to the content. More... | |
const void * | data () const BOND_NOEXCEPT |
Void pointer to the content. More... | |
uint32_t | length () const BOND_NOEXCEPT |
Length of the content. More... | |
uint32_t | size () const BOND_NOEXCEPT |
Length of the content. More... | |
bool | empty () const BOND_NOEXCEPT |
Check if the blob is empty (i.e. lenght == 0) More... | |
const_iterator | begin () const BOND_NOEXCEPT |
Iterator for the beginning of the blob. More... | |
const_iterator | end () const BOND_NOEXCEPT |
Iterator for the end of the blob. More... | |
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. More... | |
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.