awds::BasePacket Class Reference

base data structure for representing packets. More...

#include <BasePacket.h>

List of all members.

Public Types

typedef void(* SendCallback )(BasePacket &p, void *data, ssize_t size)

Public Member Functions

int receive (gea::Handle *h)
void setSendCallback (SendCallback cb, void *data)
int ref ()
 increase the reference counter.
int unref ()
 decrease the reference counter.
PacketType getType () const
void setType (PacketType pt)
void setDest (const NodeId &dest)

Public Attributes

char buffer [MaxSize]
size_t size
int refcount
SendCallback cb
void * cb_data
NodeId dest

Static Public Attributes

static const int MaxSize = 0x1000


Detailed Description

base data structure for representing packets.

The BasePacket class is used for holding the data of a packet.


Member Function Documentation

int awds::BasePacket::unref (  )  [inline]

decrease the reference counter.

This method decreases the reference counter. When its value becomes zero, the packet is automatically deallocated.

See also:
awds::BasePacket::ref()

References refcount.

Referenced by Pinger::next_ping(), Pinger::ping_recv(), and awds::AwdsRouting::send_topo().


Member Data Documentation

const int awds::BasePacket::MaxSize = 0x1000 [static]

The maximum number of bytes per packet

the refcount is used for memory management.

See also:
BasePacket::ref()

BasePacket::unref()

Referenced by ref(), and unref().

the number of bytes in the packet, including all headers

Referenced by awds::RTopology::feed(), Pinger::next_ping(), awds::TopoPacket::print(), awds::AwdsRouting::send_topo(), and awds::TopoPacket::setNeigh().


The documentation for this class was generated from the following file:

Generated on Fri Mar 27 13:58:26 2009 for AWDS by  doxygen 1.5.8