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.
 Data_ ()
 Constructors and destructor.
 Data_ (const ::size_t size)
 Data_ (const Data_ &other)
template<class T>
 Data_ (const Data_< T > &other)
 ~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_ (  )  [inline]

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]

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.

References olsr::utl::Data_< Self >::data_.

Referenced by olsr::msg::TCMessage::dump(), olsr::msg::MIDMessage::dump(), and olsr::msg::HNAMessage::dump().

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

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

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

Create new smaller instances.

References olsr::utl::Data_< Self >::exact(), and olsr::utl::Data_< Self >::instance_size_.

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).

References olsr::utl::Data_< Self >::exact().

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 [inline]

Return size() - rhs.size().

References olsr::utl::Data_< Self >::instance_size_.

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

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

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

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

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

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

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


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 Thu Feb 12 20:45:39 2009 for Qolyester daemon by  doxygen 1.5.6