Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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

UInt16 _id
UChar8 _data [OSG_DGRAM_LEN-2]
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]
 

Definition at line 52 of file OSGDgram.inl.

References _buffer, and osg::osgntohs().

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

00053 {
00054     return osgntohs(_buffer._id);
00055 }

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]
 

Definition at line 57 of file OSGDgram.inl.

References _size.

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

00058 {
00059     return _size;
00060 }

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]
 

Definition at line 72 of file OSGDgram.inl.

References _buffer.

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

00073 {
00074     return (UChar8 *)&_buffer;
00075 }

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

Definition at line 77 of file OSGDgram.inl.

References _buffer, and _size.

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

00078 {
00079     return _size + sizeof(_buffer._id);
00080 }

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]
 

Definition at line 100 of file OSGDgram.inl.

References _size.

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

00101 {
00102     _size = size;
00103 }

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

Definition at line 105 of file OSGDgram.inl.

References _size.

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

00106 {
00107     _size = sizeof(UChar8);
00108 }

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

Definition at line 110 of file OSGDgram.inl.

References _buffer, and osg::osghtons().

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

00111 {
00112     _buffer._id = osghtons(id);
00113 }

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

UInt32 osg::Dgram::_size [protected]
 

Definition at line 133 of file OSGDgram.h.

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

UInt16 osg::Dgram::_id [protected]
 

Definition at line 135 of file OSGDgram.h.

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

Definition at line 136 of file OSGDgram.h.

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

Referenced by getBuffer(), getBufferCapacity(), getBufferSize(), getCapacity(), getData(), getId(), getResponseAck(), setBufferSize(), setId(), and setResponseAck().


The documentation for this class was generated from the following files:
Generated on Thu Aug 25 04:12:52 2005 for OpenSG by  doxygen 1.4.3