osg::Dgram Class Reference
[Network]

Datagram used for reliable multicast.

#include <OSGDgram.h>

List of all members.

compare



bool operator< (const Dgram &other) const
static bool less (UInt16, UInt16)

Public Member Functions

constructor


 Dgram ()
 ~Dgram ()
get


UInt32 getCapacity (void) const
UInt16 getId (void) const
bool getResponseAck (void) const
UInt32 getSize (void) const
UChar8getData (void)
const UChar8getData (void) const
UChar8getBuffer (void)
UInt32 getBufferSize (void) const
UInt32 getBufferCapacity (void) const
bool getEarlySend (void) const
set


void setSize (UInt32 size)
void setResponseSize (void)
void setId (UInt16 id)
void setResponseAck (bool value)
void setBufferSize (UInt32 size)
void setEarlySend (bool value)

Static Public Member Functions

create, release


static Dgramcreate (void)
static void release (Dgram *dgram)

Protected Attributes

member


bool _earlySend
UInt32 _size
struct {
   UInt16   _id
   UChar8   _data [OSG_DGRAM_LEN-2]
_buffer


Detailed Description

Definition at line 64 of file OSGDgram.h.


Constructor & Destructor Documentation

Dgram::Dgram (  ) 

constructor. Use Dgram::create to get dgrams

Definition at line 62 of file OSGDgram.cpp.

00062             :
00063     _size(0),
00064     _earlySend(false)
00065 {
00066 }

Dgram::~Dgram (  ) 

destructor. Use Dgram::release to free dgrams

Definition at line 70 of file OSGDgram.cpp.

00071 {
00072 }


Member Function Documentation

static Dgram* osg::Dgram::create ( void   )  [inline, static]

static void osg::Dgram::release ( Dgram dgram  )  [inline, static]

UInt32 osg::Dgram::getCapacity ( void   )  const [inline]

Definition at line 47 of file OSGDgram.inl.

References _buffer.

Referenced by osg::GroupMCastConnection::write().

00048 {
00049     return sizeof(_buffer) - sizeof(_buffer._id);
00050 }

UInt16 osg::Dgram::getId ( void   )  const [inline]

bool osg::Dgram::getResponseAck ( void   )  const [inline]

Definition at line 87 of file OSGDgram.inl.

References _buffer.

Referenced by osg::PointMCastConnection::recvQueue(), and osg::GroupMCastConnection::sendQueue().

00088 {
00089     return _buffer._data[0];
00090 }

UInt32 osg::Dgram::getSize ( void   )  const [inline]

UChar8 * osg::Dgram::getData ( void   )  [inline]

Definition at line 62 of file OSGDgram.inl.

References _buffer.

Referenced by osg::PointMCastConnection::read(), osg::PointMCastConnection::readBuffer(), and osg::GroupMCastConnection::write().

00063 {
00064     return _buffer._data;
00065 }

const UChar8 * osg::Dgram::getData ( void   )  const [inline]

Definition at line 67 of file OSGDgram.inl.

References _buffer.

00068 {
00069     return _buffer._data;
00070 }

UChar8 * osg::Dgram::getBuffer ( void   )  [inline]

UInt32 osg::Dgram::getBufferSize ( void   )  const [inline]

UInt32 osg::Dgram::getBufferCapacity ( void   )  const [inline]

Definition at line 82 of file OSGDgram.inl.

References _buffer.

Referenced by osg::PointMCastConnection::recvNextDgram(), and osg::GroupMCastConnection::sendQueue().

00083 {
00084     return sizeof(_buffer);
00085 }

bool osg::Dgram::getEarlySend ( void   )  const [inline]

Definition at line 92 of file OSGDgram.inl.

References _earlySend.

00093 {
00094     return _earlySend;
00095 }

void osg::Dgram::setSize ( UInt32  size  )  [inline]

void osg::Dgram::setResponseSize ( void   )  [inline]

void osg::Dgram::setId ( UInt16  id  )  [inline]

void osg::Dgram::setResponseAck ( bool  value  )  [inline]

Definition at line 120 of file OSGDgram.inl.

References _buffer.

Referenced by osg::PointMCastConnection::combineAck(), osg::PointMCastConnection::recvNextDgram(), and osg::PointMCastConnection::recvQueue().

00121 {
00122     _buffer._data[0] = value;
00123 }

void osg::Dgram::setBufferSize ( UInt32  size  )  [inline]

Definition at line 115 of file OSGDgram.inl.

References _buffer, and _size.

Referenced by osg::PointMCastConnection::recvNextDgram().

00116 {
00117     _size = size - sizeof(_buffer._id);
00118 }

void osg::Dgram::setEarlySend ( bool  value  )  [inline]

Definition at line 125 of file OSGDgram.inl.

References _earlySend.

Referenced by osg::GroupMCastConnection::write().

00126 {
00127     _earlySend = value;
00128 }

bool osg::Dgram::operator< ( const Dgram other  )  const [inline]

Compare IDs. Use Window.

Definition at line 135 of file OSGDgram.inl.

References getId(), and less().

00136 {
00137     return less(this->getId(),other.getId());
00138 }

bool osg::Dgram::less ( UInt16  a,
UInt16  b 
) [inline, static]

Compare IDs. Use Window.

Definition at line 142 of file OSGDgram.inl.

Referenced by osg::PointMCastConnection::combineAck(), operator<(), osg::PointMCastConnection::recvQueue(), and osg::GroupMCastConnection::sendQueue().

00143 {
00144     a = a - b;
00145 
00146     if(a & 0x8000)
00147         return true;
00148     else
00149         return false;
00150 }


Member Data Documentation

bool osg::Dgram::_earlySend [protected]

Definition at line 132 of file OSGDgram.h.

Referenced by getEarlySend(), and setEarlySend().

Definition at line 133 of file OSGDgram.h.

Referenced by getBufferSize(), getSize(), setBufferSize(), setResponseSize(), and setSize().

Definition at line 135 of file OSGDgram.h.

UChar8 osg::Dgram::_data[OSG_DGRAM_LEN-2]

Definition at line 136 of file OSGDgram.h.

struct { ... } osg::Dgram::_buffer [protected]


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

Generated on Mon Mar 17 11:11:04 2008 for OpenSG by  doxygen 1.5.5