DDPHandler Class Reference

#include <DDPHandler.h>

Inheritance diagram for DDPHandler:

UDPEndpoint IPEndpoint List of all members.

Public Member Functions

 DDPHandler ()
 ~DDPHandler ()
void initDDPHandler ()
void sendDDPPackage ()
virtual void onReceive (void *data, int size)

Public Attributes

DDPListEntry list [Player::numOfPlayerNumbers-1]

Private Attributes

DDPPackage thePackage
unsigned long timeLastPackage

Detailed Description

This class handles the Dog-Discovery-Protocol DDP. Its used to find out the IP-addresses of the teammates and stors them in a list. This list is then used by the UDPHandler for the team-communication

Definition at line 51 of file DDPHandler.h.


Constructor & Destructor Documentation

DDPHandler::DDPHandler (  ) 

Definition at line 19 of file DDPHandler.cpp.

References list, Player::numOfPlayerNumbers, DDPListEntry::port, timeLastPackage, and DDPListEntry::timeLastSeen.

DDPHandler::~DDPHandler (  )  [inline]

Definition at line 55 of file DDPHandler.h.


Member Function Documentation

void DDPHandler::initDDPHandler (  ) 

does stuff which can only be done after aperios completly runs

Definition at line 31 of file DDPHandler.cpp.

References UDPEndpoint::bind(), and DDPPORT.

Referenced by UDPHandler::start().

void DDPHandler::onReceive ( void *  data,
int  size 
) [virtual]

called by the framework if a package is recived on the DDP-Port

Reimplemented from UDPEndpoint.

Definition at line 36 of file DDPHandler.cpp.

References ASSERT, SystemCall::getCurrentSystemTime(), getPlayer(), Player::getPlayerNumber(), SystemCall::getTimeSince(), idText, INFO, int(), DDPListEntry::ip, UDPEndpoint::ipOfLastPackage, list, DDPListEntry::port, text, and DDPListEntry::timeLastSeen.

void DDPHandler::sendDDPPackage (  ) 

sends a ddp-package. This is periodically called by the UDP-Handler

Definition at line 87 of file DDPHandler.cpp.

References DDPPORT, SystemCall::getCurrentSystemTime(), getPlayer(), Player::getPlayerNumber(), Player::getTeamColor(), SystemCall::getTimeSince(), DDPPackage::playerNumber, UDPEndpoint::send(), DDPPackage::teamColor, DDPPackage::teamIdentifier, thePackage, and timeLastPackage.

Referenced by UDPHandler::doRegularStuff().


Member Data Documentation

DDPListEntry DDPHandler::list[Player::numOfPlayerNumbers-1]

List of the other robots

Definition at line 61 of file DDPHandler.h.

Referenced by DDPHandler(), UDPHandlerEndpoint::onReceive(), onReceive(), and UDPHandlerEndpoint::sendPackage().

DDPPackage DDPHandler::thePackage [private]

Buffer for the DDPPackage to send

Definition at line 64 of file DDPHandler.h.

Referenced by sendDDPPackage().

unsigned long DDPHandler::timeLastPackage [private]

Time when the last DDPPackage was send

Definition at line 65 of file DDPHandler.h.

Referenced by DDPHandler(), and sendDDPPackage().


The documentation for this class was generated from the following files:
Generated on Thu Dec 7 01:27:33 2006 for DT2005.panorama by  doxygen 1.4.7