olsr::utl::Data_< Self > Struct Template Reference

Base class for Data and ConstData. More...

#include <data.hh>

Inheritance diagram for olsr::utl::Data_< Self >:

olsr::utl::ConstData olsr::utl::Data List of all members.

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_datadata_
::size_t instance_size_
unsigned offset_

Friends

class Data_< typename internal::other< Self >::return_type >

Detailed Description

template<class Self>
struct olsr::utl::Data_< Self >

Base class for Data and ConstData.


Constructor & Destructor Documentation

template<class Self>
olsr::utl::Data_< Self >::Data_ (  ) 

Constructors and destructor.

template<class Self>
olsr::utl::Data_< Self >::Data_ ( const ::size_t  size  )  [inline, explicit]

template<class Self>
olsr::utl::Data_< Self >::Data_ ( const Data_< Self > &  other  )  [inline]

template<class Self>
template<class T>
olsr::utl::Data_< Self >::Data_ ( const Data_< T > &  other  )  [inline]

template<class Self>
olsr::utl::Data_< Self >::~Data_ (  )  [inline]

template<class Self>
olsr::utl::Data_< Self >::Data_ (  ) 

Constructors and destructor.

template<class Self>
olsr::utl::Data_< Self >::Data_ ( const ::size_t  size  )  [inline, explicit]

template<class Self>
olsr::utl::Data_< Self >::Data_ ( const Data_< Self > &  other  )  [inline]

template<class Self>
template<class T>
olsr::utl::Data_< Self >::Data_ ( const Data_< T > &  other  )  [inline]

template<class Self>
olsr::utl::Data_< Self >::~Data_ (  )  [inline]


Member Function Documentation

template<class Self>
template<class T>
Self & olsr::utl::Data_< Self >::operator= ( const Data_< T > &  other  )  [inline]

Affectation.

template<class Self>
Self & olsr::utl::Data_< Self >::operator= ( const Data_< Self > &  other  )  [inline]

template<class Self>
bool olsr::utl::Data_< Self >::empty (  )  const [inline]

Tell whether this object has an attached buffer or not.

Warning:
*Not* equivalent to size() == 0.

template<class Self>
size_t olsr::utl::Data_< Self >::size (  )  const

Get the available size at raw().

template<class Self>
void olsr::utl::Data_< Self >::fit ( unsigned  len  )  [inline]

Resize the buffer.

template<class Self>
Self olsr::utl::Data_< Self >::shrink_by ( unsigned  len  )  const [inline]

Create new smaller instances.

template<class Self>
Self olsr::utl::Data_< Self >::shrink_to ( unsigned  len  )  const [inline]

template<class Self>
Self olsr::utl::Data_< Self >::operator+ ( unsigned  offset  )  const [inline]

Create new instances with greater offset (and smaller instance size).

template<class Self>
Self & olsr::utl::Data_< Self >::operator+= ( unsigned  offset  )  [inline]

template<class Self>
template<class T>
size_t olsr::utl::Data_< Self >::operator- ( const Data_< T > &  rhs  )  const

Return size() - rhs.size().

template<class Self>
const u_int8_t * olsr::utl::Data_< Self >::raw (  )  const [inline]

Access the raw data.

template<class Self>
void olsr::utl::Data_< Self >::dump ( u_int8_t *  p  )  const [inline]

Copy the data to a specific location.

template<class Self>
void olsr::utl::Data_< Self >::dump ( Data_< Data > &  d  )  const [inline]

template<class Self>
Self & olsr::utl::Data_< Self >::exact (  )  [inline]

Retrieve the exact type of Data_<Self> (i.e. cast to self).

template<class Self>
const Self & olsr::utl::Data_< Self >::exact (  )  const [inline]

template<class Self>
void olsr::utl::Data_< Self >::use (  )  [inline, protected]

Increment the buffer's usecount.

template<class Self>
void olsr::utl::Data_< Self >::unuse (  )  [inline, protected]

Decrement the buffer's usecount.


Friends And Related Function Documentation

template<class Self>
friend class Data_< typename internal::other< Self >::return_type > [friend]


Member Data Documentation

template<class Self>
internal::shared_data* olsr::utl::Data_< Self >::data_ [protected]

template<class Self>
::size_t olsr::utl::Data_< Self >::instance_size_ [protected]

template<class Self>
unsigned olsr::utl::Data_< Self >::offset_ [protected]


The documentation for this struct was generated from the following files:
Generated on Mon Sep 10 17:02:14 2007 for Qolyester daemon by  doxygen 1.5.1