OSG::Dgram Class Reference

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 (void)
 ~Dgram (void)
get


UInt32 getCapacity (void) const
UInt16 getId (void) const
bool getResponseAck (void) const
UInt32 getSize (void) const
UChar8 * getData (void)
const UChar8 * getData (void) const
UChar8 * getBuffer (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 63 of file OSGDgram.h.


Constructor & Destructor Documentation

Dgram::Dgram ( void   ) 

Definition at line 63 of file OSGDgram.cpp.

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

Dgram::~Dgram ( void   ) 

destructor. Use Dgram::release to free dgrams

Definition at line 72 of file OSGDgram.cpp.

00073 {
00074 }


Member Function Documentation

static Dgram* OSG::Dgram::create ( void   )  [static]

static void OSG::Dgram::release ( Dgram dgram  )  [static]

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

Definition at line 48 of file OSGDgram.inl.

References _buffer.

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

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

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

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

Definition at line 96 of file OSGDgram.inl.

References _buffer.

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

00097 {
00098     return (_buffer._data[0] != 0);
00099 }

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

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

Definition at line 66 of file OSGDgram.inl.

References _buffer.

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

00067 {
00068     return _buffer._data;
00069 }

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

Definition at line 72 of file OSGDgram.inl.

References _buffer.

00073 {
00074     return _buffer._data;
00075 }

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

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

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

Definition at line 90 of file OSGDgram.inl.

References _buffer.

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

00091 {
00092     return sizeof(_buffer);
00093 }

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

Definition at line 102 of file OSGDgram.inl.

References _earlySend.

00103 {
00104     return _earlySend;
00105 }

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 135 of file OSGDgram.inl.

References _buffer.

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

00136 {
00137     _buffer._data[0] = value;
00138 }

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

Definition at line 129 of file OSGDgram.inl.

References _buffer, and _size.

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

00130 {
00131     _size = size - sizeof(_buffer._id);
00132 }

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

Definition at line 141 of file OSGDgram.inl.

References _earlySend.

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

00142 {
00143     _earlySend = value;
00144 }

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

Definition at line 165 of file OSGDgram.inl.

References getId(), and less().

00166 {
00167     return less(this->getId(),other.getId());
00168 }

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

Compare IDs. Use Window.

Definition at line 151 of file OSGDgram.inl.

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

00152 {
00153     a = a - b;
00154 
00155     if(a & 0x8000)
00156         return true;
00157     else
00158         return false;
00159 }


Member Data Documentation

bool OSG::Dgram::_earlySend [protected]

Definition at line 133 of file OSGDgram.h.

Referenced by getEarlySend(), and setEarlySend().

UInt32 OSG::Dgram::_size [protected]

Definition at line 134 of file OSGDgram.h.

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

Definition at line 138 of file OSGDgram.h.

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

Definition at line 139 of file OSGDgram.h.

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


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