#include <data.hh>
Inheritance diagram for olsr::utl::Data_< Self >:
Public Member Functions | |
template<class T> | |
Self & | operator= (const Data_< T > &other) |
Affectation. | |
Self & | operator= (const Data_< Self > &other) |
bool | empty () const |
inline::size_t | size () const |
Get the available size at raw(). | |
void | fit (unsigned len) |
Resize the buffer. | |
template<class T> | |
inline::size_t | operator- (const Data_< T > &rhs) const |
Return size() - rhs.size(). | |
const u_int8_t * | raw () const |
Access the raw data. | |
Self | shrink_by (unsigned len) const |
Create new smaller instances. | |
Self | shrink_to (unsigned len) const |
Self | operator+ (unsigned offset) const |
Create new instances with greater offset (and smaller instance size). | |
Self & | operator+= (unsigned offset) |
void | dump (u_int8_t *p) const |
Copy the data to a specific location. | |
void | dump (Data_< Data > &d) const |
Self & | exact () |
Retrieve the exact type of Data_<Self> (i.e. cast to self). | |
const Self & | exact () const |
Protected Member Functions | |
void | use () |
Increment the buffer's usecount. | |
void | unuse () |
Decrement the buffer's usecount. | |
Protected Attributes | |
internal::shared_data * | data_ |
::size_t | instance_size_ |
unsigned | offset_ |
Friends | |
class | Data_< typename internal::other< Self >::return_type > |
olsr::utl::Data_< Self >::Data_ | ( | ) |
Constructors and destructor.
olsr::utl::Data_< Self >::Data_ | ( | const ::size_t | size | ) | [inline, explicit] |
olsr::utl::Data_< Self >::Data_ | ( | const Data_< Self > & | other | ) | [inline] |
olsr::utl::Data_< Self >::Data_ | ( | const Data_< T > & | other | ) | [inline] |
olsr::utl::Data_< Self >::~Data_ | ( | ) | [inline] |
olsr::utl::Data_< Self >::Data_ | ( | ) |
Constructors and destructor.
olsr::utl::Data_< Self >::Data_ | ( | const ::size_t | size | ) | [inline, explicit] |
olsr::utl::Data_< Self >::Data_ | ( | const Data_< Self > & | other | ) | [inline] |
olsr::utl::Data_< Self >::Data_ | ( | const Data_< T > & | other | ) | [inline] |
olsr::utl::Data_< Self >::~Data_ | ( | ) | [inline] |
Self & olsr::utl::Data_< Self >::operator= | ( | const Data_< T > & | other | ) | [inline] |
Affectation.
Self & olsr::utl::Data_< Self >::operator= | ( | const Data_< Self > & | other | ) | [inline] |
bool olsr::utl::Data_< Self >::empty | ( | ) | const [inline] |
Tell whether this object has an attached buffer or not.
size_t olsr::utl::Data_< Self >::size | ( | ) | const |
Get the available size at raw().
void olsr::utl::Data_< Self >::fit | ( | unsigned | len | ) | [inline] |
Resize the buffer.
Self olsr::utl::Data_< Self >::shrink_by | ( | unsigned | len | ) | const [inline] |
Create new smaller instances.
Self olsr::utl::Data_< Self >::shrink_to | ( | unsigned | len | ) | const [inline] |
Self olsr::utl::Data_< Self >::operator+ | ( | unsigned | offset | ) | const [inline] |
Create new instances with greater offset (and smaller instance size).
Self & olsr::utl::Data_< Self >::operator+= | ( | unsigned | offset | ) | [inline] |
size_t olsr::utl::Data_< Self >::operator- | ( | const Data_< T > & | rhs | ) | const |
Return size() - rhs.size().
const u_int8_t * olsr::utl::Data_< Self >::raw | ( | ) | const [inline] |
Access the raw data.
void olsr::utl::Data_< Self >::dump | ( | u_int8_t * | p | ) | const [inline] |
Copy the data to a specific location.
void olsr::utl::Data_< Self >::dump | ( | Data_< Data > & | d | ) | const [inline] |
Self & olsr::utl::Data_< Self >::exact | ( | ) | [inline] |
Retrieve the exact type of Data_<Self> (i.e. cast to self).
const Self & olsr::utl::Data_< Self >::exact | ( | ) | const [inline] |
void olsr::utl::Data_< Self >::use | ( | ) | [inline, protected] |
Increment the buffer's usecount.
void olsr::utl::Data_< Self >::unuse | ( | ) | [inline, protected] |
Decrement the buffer's usecount.
friend class Data_< typename internal::other< Self >::return_type > [friend] |
internal::shared_data* olsr::utl::Data_< Self >::data_ [protected] |
::size_t olsr::utl::Data_< Self >::instance_size_ [protected] |
unsigned olsr::utl::Data_< Self >::offset_ [protected] |